Node.js the Right Way

Book description

Get to the forefront of server-side JavaScript programming by writing compact, robust, fast, networked Node applications that scale. Ready to take JavaScript beyond the browser, explore dynamic languages features and embrace evented programming? Explore the fun, growing repository of Node modules provided by npm. Work with multiple protocols, load-balanced RESTful web services, express, 0MQ, Redis, CouchDB, and more. Develop production-grade Node applications fast.

Table of contents

  1. Node.js the Right Way
  2. For the Best Reading Experience...
  3. Table of Contents
  4. Early praise for Node.js the Right Way
  5. Acknowledgments
  6. Preface
    1. Why Node.js the Right Way
    2. What’s in This Book
    3. What This Book Is Not
    4. Code Examples and Conventions
    5. Online Resources
  7. Chapter 1: Getting Started
    1. Node’s Niche
    2. How Node Applications Work
    3. Aspects of Node.js Development
    4. Get Node.js
  8. Chapter 2: Wrangling the File System
    1. Programming for the Node.js Event Loop
    2. Spawning a Child Process
    3. Capturing Data from an EventEmitter
    4. Reading and Writing Files Asynchronously
    5. The Two Phases of a Node Program
    6. Wrapping Up
  9. Chapter 3: Networking with Sockets
    1. Listening for Socket Connections
    2. Implementing a Messaging Protocol
    3. Creating Socket Client Connections
    4. Testing Network Application Functionality
    5. Extending Core Classes in Custom Modules
    6. Wrapping Up
  10. Chapter 4: Robust Messaging Services
    1. Advantages of ØMQ
    2. Importing External Modules with npm
    3. Message-Publishing and -Subscribing
    4. Responding to Requests
    5. Routing and Dealing Messages
    6. Clustering Node.js Processes
    7. Pushing and Pulling Messages
    8. Wrapping Up
  11. Chapter 5: Accessing Databases
    1. Advantages of CouchDB
    2. Creating a Package
    3. Making RESTful Requests
    4. Importing Real Data
    5. Unit Testing with Nodeunit
    6. Throttling Node.js
    7. Querying Data with Mapreduce Views
    8. Wrapping Up
  12. Chapter 6: Scalable Web Services
    1. Advantages of Express
    2. Serving APIs with Express
    3. Writing Modular Express Services
    4. RESTful APIs with Promises
    5. Yielding Control with Generators
    6. Using Generators with Promises
    7. Wrapping Up
  13. Chapter 7: Web Apps
    1. Storing Express Sessions in Redis
    2. Creating a Single-Page Web Application
    3. Authenticating with Passport
    4. Authorizing APIs with Custom Middleware
    5. Creating Authenticated APIs
    6. Client-Side MVC
    7. Wrapping Up
    8. Parting Thoughts
    9. You May Be Interested In…

Product information

  • Title: Node.js the Right Way
  • Author(s): Jim R. Wilson
  • Release date: November 2013
  • Publisher(s): Pragmatic Bookshelf
  • ISBN: 9781937785734