Mastering Node.js

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.

Mastering Node.js

Mastering
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.
$29.99
$49.99
RRP $29.99
RRP $49.99
eBook
Print + eBook
$12.99 p/month

Get Access

Get Unlimited Access to every Packt eBook and Video course

Enjoy full and instant access to over 3000 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
V8
The process object
The Read-Eval-Print Loop and executing a Node program
Summary
Chapter 2: Understanding Asynchronous Event-Driven Programming
Broadcasting events
Listening for events
Timers
Understanding the event loop
Callbacks and errors
Listening for file changes
Summary
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
Summary
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
Summary
Chapter 5: Managing Many Simultaneous Client Connections
Understanding concurrency
Routing requests
Using Redis for tracking client state
Handling sessions
Authenticating connections
Summary
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
Summary
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
Summary
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
Summary
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
Summary

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.

Authors

Table of Contents

Chapter 1: Understanding the Node Environment
Extending JavaScript
V8
The process object
The Read-Eval-Print Loop and executing a Node program
Summary
Chapter 2: Understanding Asynchronous Event-Driven Programming
Broadcasting events
Listening for events
Timers
Understanding the event loop
Callbacks and errors
Listening for file changes
Summary
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
Summary
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
Summary
Chapter 5: Managing Many Simultaneous Client Connections
Understanding concurrency
Routing requests
Using Redis for tracking client state
Handling sessions
Authenticating connections
Summary
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
Summary
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
Summary
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
Summary
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
Summary

Book Details

ISBN 139781782166320
Paperback346 pages
Read More