Mastering Node.js - Second Edition

Expert techniques for building fast servers and scalable, real-time network applications with minimal effort; rewritten for Node.js 8 and Node.js 9
Preview in Mapt

Mastering Node.js - Second Edition

Sandro Pasquali, Kevin Faaborg

1 customer reviews
Expert techniques for building fast servers and scalable, real-time network applications with minimal effort; rewritten for Node.js 8 and Node.js 9

Quick links: > What will you learn?> Table of content> Product reviews

eBook
$28.00
RRP $39.99
Save 29%
Print + eBook
$49.99
RRP $49.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$28.00
$49.99
RRP $39.99
RRP $49.99
eBook
Print + eBook

Frequently bought together


Mastering Node.js - Second Edition Book Cover
Mastering Node.js - Second Edition
$ 39.99
$ 28.00
RESTful Web API Design with Node.js - Second Edition [Video] Book Cover
RESTful Web API Design with Node.js - Second Edition [Video]
$ 124.99
$ 106.25
Buy 2 for $35.00
Save $129.98
Add to Cart

Book Details

ISBN 139781785888960
Paperback498 pages

Book Description

Node.js, a modern development environment that enables developers to write server- and client-side code with JavaScript, thus becoming a popular choice among developers.

This book covers the features of Node that are especially helpful to developers creating highly concurrent real-time applications. It takes you on a tour of Node's innovative event non-blocking design, showing you how to build professional applications. This edition has been updated to cover the latest features of Node 9 and ES6. All code examples and demo applications have been completely rewritten using the latest techniques, introducing Promises, functional programming, async/await, and other cutting-edge patterns for writing JavaScript code. Learn how to use microservices to simplify the design and composition of distributed systems. From building serverless cloud functions to native C++ plugins, from chatbots to massively scalable SMS-driven applications, you'll be prepared for building the next generation of distributed software.

By the end of this book, you'll be building better Node applications more quickly, with less code and more power, and know how to run them at scale in production environments.

Table of Contents

Chapter 1: Understanding the Node Environment
Introduction – JavaScript as a systems language
Standard libraries
Extending JavaScript
V8, JavaScript, and optimizations
The process object
The REPL
 Summary
Chapter 2: Understanding Asynchronous Event-Driven Programming
Node's unique design
Understanding the event loop
Listening for events
Timers
Concurrency and errors
Building a Twitter feed using file events
Summary
Chapter 3: Streaming Data Across Nodes and Clients
Why use streams?
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
A simple file browser
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: Using Multiple Processes
Node's single-threaded model
Creating child processes
Communicating with your child
Parsing a file using multiple processes
Using PM2 to manage 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
Using Twilio to create an SMS bot on Heroku
Summary
Chapter 9: Microservices
Why microservices?
From 3-Tiers to 4-Tiers
Deploying microservices
Serverless applications
Containerized microservices
Summary
Chapter 10: Testing Your Application
Why testing is important
Native Node testing and debugging tools
Testing with Mocha, Chai, and Sinon
Headless testing with Nightmare and Puppeteer
Testing the terrain
Testing processes, memory, and CPU
Summary
Chapter 11: Organizing Your Work into Modules
How to load and use modules
The module object
How Node handles module paths
Creating a package file
Chapter 12: Creating Your Own C++ Add-ons
Hello World
A calculator
Using NAN
Closing thoughts
Links and resources

What You Will Learn

  • Build an Electron desktop app using Node that manages a filesystem
  • Explore Streams and understand how they apply to building networked services
  • Develop and deploy an SMS-driven customer service application
  • Use WebSockets for rapid bi-directional communication
  • Construct serverless applications with Amazon Lambda
  • Test and debug with headless browsers, CPU profiling, Mocha, Sinon, and more
  • Scale applications vertically and horizontally across multiple cores and web services

Authors

Table of Contents

Chapter 1: Understanding the Node Environment
Introduction – JavaScript as a systems language
Standard libraries
Extending JavaScript
V8, JavaScript, and optimizations
The process object
The REPL
 Summary
Chapter 2: Understanding Asynchronous Event-Driven Programming
Node's unique design
Understanding the event loop
Listening for events
Timers
Concurrency and errors
Building a Twitter feed using file events
Summary
Chapter 3: Streaming Data Across Nodes and Clients
Why use streams?
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
A simple file browser
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: Using Multiple Processes
Node's single-threaded model
Creating child processes
Communicating with your child
Parsing a file using multiple processes
Using PM2 to manage 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
Using Twilio to create an SMS bot on Heroku
Summary
Chapter 9: Microservices
Why microservices?
From 3-Tiers to 4-Tiers
Deploying microservices
Serverless applications
Containerized microservices
Summary
Chapter 10: Testing Your Application
Why testing is important
Native Node testing and debugging tools
Testing with Mocha, Chai, and Sinon
Headless testing with Nightmare and Puppeteer
Testing the terrain
Testing processes, memory, and CPU
Summary
Chapter 11: Organizing Your Work into Modules
How to load and use modules
The module object
How Node handles module paths
Creating a package file
Chapter 12: Creating Your Own C++ Add-ons
Hello World
A calculator
Using NAN
Closing thoughts
Links and resources

Book Details

ISBN 139781785888960
Paperback498 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

RESTful Web API Design with Node.js - Second Edition [Video] Book Cover
RESTful Web API Design with Node.js - Second Edition [Video]
$ 124.99
$ 106.25
Node.js Design Patterns - Second Edition Book Cover
Node.js Design Patterns - Second Edition
$ 39.99
$ 28.00
RESTful Web API Design with Node.js - Second Edition Book Cover
RESTful Web API Design with Node.js - Second Edition
$ 23.99
$ 16.80
Web Development with MongoDB and NodeJS - Second Edition Book Cover
Web Development with MongoDB and NodeJS - Second Edition
$ 31.99
$ 22.40
Mastering TypeScript - Second Edition [Video] Book Cover
Mastering TypeScript - Second Edition [Video]
$ 124.99
$ 106.25
OpenCV 3.x with Python By Example - Second Edition Book Cover
OpenCV 3.x with Python By Example - Second Edition
$ 35.99
$ 25.20