SKIP THE SHIPPING
Use code NOSHIP during checkout to save 40% on eligible eBooks, now through January 5. Shop now.
Register your product to gain access to bonus material or receive a coupon.
This PDF will be accessible from your Account page after purchase and requires PDF reading software, such as Acrobat® Reader®.
The eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.
Learning Node.jsA Hands-On Guide to Building Web Applications in JavaScript
Node.js makes it far easier to create fast, compact, and reliable web/network applications and web servers, and is rapidly becoming indispensable to modern web developers.
Learning Node.js brings together the knowledge and JavaScript code you need to build master the Node.js platform and build server-side applications with extraordinary speed and scalability.
You’ll start by installing and running Node.js, understanding the extensions it uses, and quickly writing your first app. Next, building on the basics, you’ll write more capable application servers and extend them with today’s most powerful Node.js tools and modules. Finally, you’ll discover today’s best practices for testing, running Node.js code on production servers, and writing command-line utilities.
Throughout the book, author Marc Wandschneider teaches by walking you line-by-line through carefully crafted examples, demonstrating proven techniques for creating highly efficient applications and servers.
Introduction
PART I: LEARNING TO WALK
Chapter 1 Getting Started
Installing Node.js
Running Node.js and “Hello World!”
Your First Web Server
Debugging Your Node.js Programs
Staying Up-to-Date and Finding Help
Chapter 2 A Closer Look at JavaScript
TypesChapter 3 Asynchronous Programming
Type Comparisons and Conversions
Functions
Language Constructs
Classes, Prototypes, and Inheritance
Errors and Exceptions
Some Important Node.js Globals
The Old Way of Doing ThingsPART II: LEARNING TO RUN
The Node.js Way of Doing Things
Error Handling and Asynchronous Functions
Who Am I? Maintaining a Sense of Identity
Being Polite–Learning to Give Up Control
Synchronous Function Calls
Your First JSON ServerChapter 5 Modules
Node Pattern: Asynchronous Loops
Learning to Juggle: Handling More Requests
More on the Request and Response Objects
Increased Flexibility: GET Params
Modifying Things: POST Data
Writing Simple ModulesChapter 6 Expanding Your Web Server
npm: The Node Package Manager
Consuming Modules
Writing Modules
A Module So Common It Should Be Built In
Serving Static Content with StreamsPART III: WRITING WEB APPLICATIONS
Assembling Content on the Client: Templates
Installing ExpressChapter 8 Databases I: NoSQL (MongoDB)
Routing and Layers in Express
REST API Design and Modules
Additional Middleware Functionality
Setting Up MongoDBChapter 9 Databases II: SQL (MySQL)
Structuring Your Data for MongoDB
Understanding the Basic Operations
Updating Your Photo Albums App
Recapping the App Structure
Getting ReadyPART IV: GETTING THE MOST OUT OF NODE.JS
Creating a Schema for the Database
Basic Database Operations
Adding Authentication to the Application
Resource Pooling
DeploymentChapter 11 Command-Line Programming
Multiprocessor Deployment: Using a Proxy
Virtual Hosting
Securing Your Projects with HTTPS/SSL
Multiplatform Development
Running Command-Line ScriptsChapter 12 Testing
Working with Files Synchronously
Interacting with the User: stdin/stdout
Working with Processes
Choosing a Framework
Writing Tests
RESTful API Testing