Node Cookbook - Third Edition

Over 60 high-quality recipes covering debugging, security, performance, microservices, web frameworks, databases, deployment and more; rewritten for Node 4, 6, and 8.

Node Cookbook - Third Edition

This ebook is included in a Mapt subscription
David Mark Clements et al.

Over 60 high-quality recipes covering debugging, security, performance, microservices, web frameworks, databases, deployment and more; rewritten for Node 4, 6, and 8.
$0.00
$28.00
$49.99
$29.99p/m after trial
RRP $39.99
RRP $49.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781785880087
Paperback654 pages

Book Description

The principles of asynchronous event-driven programming are perfect for today's web, where efficient real-time applications and scalability are at the forefront. Server-side JavaScript has been here since the 90s but Node got it right.

This edition is a complete rewrite of the original, and is targeted against Node 4, 6, and 8. It shows you how to build fast, efficient, and scalable client-server solutions using the latest versions of Node.

Beginning with adopting debugging tips and tricks of the trade and learning how to write your own modules, then covering the fundamentals of streams in Node.js, you will go on to discover I/O control, implementation of various web protocols, you’ll work up to integrating with cross-section of databases such as MongoDB, MySQL/MariaDB, Postgres, Redis, and LevelDB and building web application with Express, Hapi and Koa.

You will then learn about security essentials in Node.js and the advanced optimization tools and techniques By the end of the book you should have acquired a level of proficiency that allows you to confidently build a full production-ready and scalable Node.js system.

Table of Contents

Chapter 1: Debugging Processes
Introduction
Debugging Node with Chrome Devtools
Enhancing stack trace output
Enabling debug logs
Enabling core debug logs
Chapter 2: Writing Modules
Introduction
Scaffolding a module
Installing dependencies
Writing module code
Publishing a module
Using a private repository
Chapter 3: Coordinating I/O
Introduction
Interfacing with standard I/O
Working with files
Fetching metadata
Watching files and directories
Communicating over sockets
Chapter 4: Using Streams
Introduction
Processing Big Data
Using the pipe method
Piping streams in production
Creating transform streams
Creating readable and writable streams
Decoupling I/O
Chapter 5: Wielding Web Protocols
Introduction
Creating an HTTP server
Receiving POST data
Handling file uploads
Making an HTTP POST request
Communicating with WebSockets
Creating an SMTP server
Chapter 6: Persisting to Databases
Introduction
Connecting and sending SQL to a MySQL server
Connecting and sending SQL to a Postgres server
Storing and retrieving data with MongoDB
Storing and retrieving data with Redis
Embedded persistence with LevelDB
Chapter 7: Working with Web Frameworks
Introduction
Creating an express web app
Creating a Hapi web app
Creating a Koa web app
Adding a view layer
Adding logging
Implementing authentication
Chapter 8: Dealing with Security
Introduction
Detecting dependency vulnerabilities
Hardening headers in web frameworks
Anticipating malicious input
Guarding against cross site scripting (XSS)
Preventing cross site request forgery
Chapter 9: Optimizing Performance
Introduction
Benchmarking HTTP
Finding bottlenecks with flamegraphs
Optimizing a synchronous function call
Optimizing asynchronous callbacks
Profiling memory
Chapter 10: Building Microservice Systems
Introduction
Consuming a service
Setting up a development environment
Standardizing service boilerplate
Using containerized infrastructure
Service discovery with DNS
Adding a Queue Based Service
Chapter 11: Deploying Node.js
Introduction
Building a container for a Node.js process
Running a Docker registry
Storing images on DockerHub
Deploying a container to Kubernetes
Creating a deployment pipeline
Deploying a full system
Deploying to the cloud

What You Will Learn

  • Rapidly become proficient at debugging Node.js programs
  • Write and publish your own Node.js modules
  • Become deeply acquainted with Node.js core API’s
  • Use web frameworks such as Express, Hapi and Koa for accelerated web application development
  • Apply Node.js streams for low-footprint infinite-capacity data processing
  • Fast-track performance knowledge and optimization abilities
  • Compare and contrast various persistence strategies, including database integrations with MongoDB, MySQL/MariaDB, Postgres, Redis, and LevelDB
  • Grasp and apply critically essential security concepts
  • Understand how to use Node with best-of-breed deployment technologies: Docker, Kubernetes and AWS

Authors

Table of Contents

Chapter 1: Debugging Processes
Introduction
Debugging Node with Chrome Devtools
Enhancing stack trace output
Enabling debug logs
Enabling core debug logs
Chapter 2: Writing Modules
Introduction
Scaffolding a module
Installing dependencies
Writing module code
Publishing a module
Using a private repository
Chapter 3: Coordinating I/O
Introduction
Interfacing with standard I/O
Working with files
Fetching metadata
Watching files and directories
Communicating over sockets
Chapter 4: Using Streams
Introduction
Processing Big Data
Using the pipe method
Piping streams in production
Creating transform streams
Creating readable and writable streams
Decoupling I/O
Chapter 5: Wielding Web Protocols
Introduction
Creating an HTTP server
Receiving POST data
Handling file uploads
Making an HTTP POST request
Communicating with WebSockets
Creating an SMTP server
Chapter 6: Persisting to Databases
Introduction
Connecting and sending SQL to a MySQL server
Connecting and sending SQL to a Postgres server
Storing and retrieving data with MongoDB
Storing and retrieving data with Redis
Embedded persistence with LevelDB
Chapter 7: Working with Web Frameworks
Introduction
Creating an express web app
Creating a Hapi web app
Creating a Koa web app
Adding a view layer
Adding logging
Implementing authentication
Chapter 8: Dealing with Security
Introduction
Detecting dependency vulnerabilities
Hardening headers in web frameworks
Anticipating malicious input
Guarding against cross site scripting (XSS)
Preventing cross site request forgery
Chapter 9: Optimizing Performance
Introduction
Benchmarking HTTP
Finding bottlenecks with flamegraphs
Optimizing a synchronous function call
Optimizing asynchronous callbacks
Profiling memory
Chapter 10: Building Microservice Systems
Introduction
Consuming a service
Setting up a development environment
Standardizing service boilerplate
Using containerized infrastructure
Service discovery with DNS
Adding a Queue Based Service
Chapter 11: Deploying Node.js
Introduction
Building a container for a Node.js process
Running a Docker registry
Storing images on DockerHub
Deploying a container to Kubernetes
Creating a deployment pipeline
Deploying a full system
Deploying to the cloud

Book Details

ISBN 139781785880087
Paperback654 pages
Read More

Read More Reviews

Recommended for You

Node.js Web Development - Third Edition Book Cover
Node.js Web Development - Third Edition
$ 35.99
$ 25.20
Salesforce CRM - The Definitive Admin Handbook (Third Edition) Book Cover
Salesforce CRM - The Definitive Admin Handbook (Third Edition)
$ 32.99
$ 23.10
VMware vSphere 6.5 CookBook - Third Edition Book Cover
VMware vSphere 6.5 CookBook - Third Edition
$ 47.99
$ 33.60
Jenkins Continuous Integration Cookbook - Third Edition Book Cover
Jenkins Continuous Integration Cookbook - Third Edition
$ 39.99
$ 28.00
Linux Shell Scripting Cookbook - Third Edition Book Cover
Linux Shell Scripting Cookbook - Third Edition
$ 39.99
$ 28.00