Free Sample
+ Collection

Mastering Node.js

Sandro Pasquali

Using the JavaScript language you already know, this book will show you how to easily build scalable network software with Node.js. You’ll learn through practical examples and clear explanations every step of the way.
RRP $29.99
RRP $49.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781782166320
Paperback346 pages

About This Book

  • Master the latest techniques for building real-time, big data applications, integrating Facebook, Twitter, and other network services
  • Tame asynchronous programming, the event loop, and parallel data processing
  • Use the Express and Path frameworks to speed up development and deliver scalable, higher quality software more quickly

Who This Book Is For

If you’ve ever built a web page and would like to build network software using the language and style you already know, Node will make that process simple, and even fun. If you understand what a server is, what a client is, and how to write JavaScript, you are already halfway to mastering Node.js!

Table of Contents

Chapter 1: Understanding the Node Environment
Extending JavaScript
The process object
The Read-Eval-Print Loop and executing a Node program
Chapter 2: Understanding Asynchronous Event-Driven Programming
Broadcasting events
Listening for events
Understanding the event loop
Callbacks and errors
Listening for file changes
Chapter 3: Streaming Data Across Nodes and Clients
Exploring streams
Creating an HTTP server
HTTPS, TLS (SSL), and securing your server
The request object
Working with headers
Handling POST data
Creating and streaming images with Node
Chapter 4: Using Node to Access the Filesystem
Directories, and iterating over files and folders
Reading from a file
Writing to a file
Serving static files
Handling file uploads
Chapter 5: Managing Many Simultaneous Client Connections
Understanding concurrency
Routing requests
Using Redis for tracking client state
Handling sessions
Authenticating connections
Further reading
Chapter 6: Creating Real-time Applications
Introducing AJAX
Bidirectional communication with Socket.IO
Listening for Server Sent Events
Building a collaborative document editing application
Chapter 7: Utilizing Multiple Processes
Node's single-threaded model
Creating child processes
Communicating with your child
Parsing a file using multiple processes
Real-time activity updates of multiple worker results
Chapter 8: Scaling Your Application
When to scale?
Running multiple Node servers
Message queues – RabbitMQ
Using Node's UDP module
Using Amazon Web Services in your application
Authenticating with Facebook Connect
Chapter 9: Testing your Application
Why testing is important
Native Node testing and debugging tools
Headless website testing with ZombieJS and Mocha
Using Grunt, Mocha, and PhantomJS to test and deploy projects

What You Will Learn

  • Discover how Node uses Google’s V8 engine to create high-speed JavaScript on the server
  • Use events to create non-blocking systems with high throughput
  • Create secure servers across all major network protocols
  • Manage thousands of concurrent clients without slowing down
  • Handle data, files, and protocol streams with ease
  • Leverage Node’s module system to design sane applications that are easy to extend
  • Optimize and debug server-side JavaScript for increased performance
  • Learn scaling techniques and parallelize operations across multiple cores

In Detail

Node.js is a modern development stack focused on providing an easy way to build scalable network software. Backed by a growing number of large companies and a rapidly increasing developer base, Node is revolutionizing the way that software is being built today. Powered by Google’s V8 engine and built out of C++ modules, this is a JavaScript environment for the enterprise.

Mastering Node.js will take the reader deep into this exciting development environment. Beginning with a comprehensive breakdown of its innovative non-blocking evented design, Node’s structure is explained in detail, laying out how its blazingly fast I/O performance simplifies the creation of fast servers, scalable architectures, and responsive web applications.

Mastering Node.js takes you through a concise yet thorough tour of Node's innovative evented non-blocking design, showing you how to build professional applications with the help of detailed examples.

Learn how to integrate your applications with Facebook and Twitter, Amazon and Google, creating social apps and programs reaching thousands of collaborators on the cloud. See how the Express and Path frameworks make the creation of professional web applications painless. Set up one, two, or an entire server cluster with just a few lines of code, ready to scale as soon as you’re ready to launch. Move data seamlessly between databases and file systems, between clients, and across network protocols, using a beautifully designed, consistent, and predictable set of tools.

Mastering Node.js contains all of the examples and explanations you’ll need to build applications in a short amount of time and at a low cost, running on a scale and speed that would have been nearly impossible just a few years ago.


Read More