Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Mastering Node.js
  • Table Of Contents Toc
  • Feedback & Rating feedback
Mastering Node.js

Mastering Node.js

By : Sandro Pasquali
4.4 (10)
close
close
Mastering Node.js

Mastering Node.js

4.4 (10)
By: Sandro Pasquali

Overview of this book

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.
Table of Contents (14 chapters)
close
close
13
Index

What this book covers

Chapter 1, Understanding the Node Environment, gives a brief description of the particular problems Node attempts to solve, with a focus on how its single-threaded event-loop is designed, implemented, and used. We will also learn about how Google's V8 engine can be configured and managed, as well as best practices when building Node programs.

Chapter 2, Understanding Asynchronous Event-Driven Programming, digs deep into the fundamental characteristic of Node's design: event-driven, asynchronous programming. By the end of this chapter you will understand how events, callbacks, and timers are used in Node, as well as how the event loop works to enable high-speed I/O across filesystems, networks, and processes.

Chapter 3, Streaming Data Across Nodes and Clients, describes how streams of I/O data are knitted through most network software, emitted by file servers or broadcast in response to an HTTP GET request. Here we learn how Node facilitates the design, implementation, and composition of network software, using examples of HTTP servers, readable and writable file streams, and other I/O focused Node modules and patterns.

Chapter 4, Using Node to Access the Filesystem, lays out what you need to know when accessing the filesystem with Node, along with techniques for handling file uploads and other networked file operations.

Chapter 5, Managing Many Simultaneous Client Connections, shows you how Node helps in solving problems accompanying the high volume, high concurrency environments that contemporary, collaborative web applications demand. Through examples, learn how to efficiently track user state, route HTTP requests, handle sessions, and authenticate requests using the Redis database and Express web application framework.

Chapter 6, Creating Real-Time Applications, explores AJAX, Server-Sent-Events, and the WebSocket protocol, discussing their pros and cons, and how to implement each using Node. We finish the chapter by building a collaborative document editing application.

Chapter 7, Utilizing Multiple Processes, teaches how to distribute clusters of Node processes across multi-core processors, and other techniques for scaling Node applications. An investigation of the differences between programming in single and multithreaded environments leads to a discussion of how to spawn, fork, and communicate with child processes in Node, and we build an analytics tool that records, and displays, the mouse actions of multiple, simultaneous clients connected through a cluster of web sockets.

Chapter 8, Scaling Your Application, outlines some techniques for detecting when to scale, deciding how to scale, and scaling Node applications across multiple servers and cloud services, with examples including: how to use RabbitMQ as a message queue, using NGINX to proxy Node servers, and using Amazon Web Services in your application.

Chapter 9, Testing Your Application, explains how to implement unit, functional, and integration tests with Node. We will explore several testing libraries, including native Node assertion, sandboxing, and debugging modules. Examples using Grunt, Mocha, PhantomJS, and other build and testing tools accompany the discussion.

Appendix A, Organizing Your Work, gives tips on using the npm package management system. Learn how create packages, publish packages, and manage packages.

Appendix B, Introducing the Path Framework, demonstrates how to use this powerful full-stack application framework to build your next web application using only JavaScript, thanks to Node and its ability to handle thousands of simultaneously connected clients.

Appendix C, Creating Your Own C++ Add-ons, provides a brief introduction on how to build your own C++ add-ons, and how to use them from within Node.

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY