Synopses & Reviews
Learning Node.js A 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.
- Build Node.js solutions that leverage your current JavaScript skills
- Master Node.js nonblocking IO and async programming
- Handle more requests and increase your application’s flexibility
- Use and write your own modules
- Perform common JSON/web server tasks
- Use browsers to generate pages on the fly via Ajax calls and template libraries
- Simplify development with the express framework
- Create database back-ends using popular NoSQL and relational databases
- Deploy and run Node.js apps on Unix/OS X or Windows servers
- Take advantage of multiprocessor hardware
- Support virtual hosts and SSL/HTTPS security
- Test Node.js programs that mix synchronous, async, and RESTful server API functionality
Synopsis
Node.js makes it easier than it’s ever been to create fast, compact, and reliable web/network applications and web servers. Building on extraordinary “word-of-mouth,” Node.js adoption is accelerating -- rapidly reaching “critical mass” as a must-know web development technology. Now, for the first time, there’s a 100% practical tutorial and reference for every Node.js newcomer or recent adopter.
Unlike other Node.js books, Learning Node.js doesn’t simply tour the API or overwhelm you with theory. Instead, pioneering web developer Marc Wandschneider brings together all the knowledge you need to build outstanding web solutions with Node.js. After introducing the technology and demonstrating why it’s so valuable and exciting, Wandschneider shows how to:
- Build server-side solutions that leverage JavaScript skills you may already have
- Write faster, more compact, more reliable applications and web servers
- Make the most of Node.js’s key features and modules
- Work with popular NoSQL and relational databases
- Perform common JSON/web server tasks
- And much more
About the Author
Marc Wandschneider co-founded Adylitica, a leading specialist in massively scalable web and mobile app design and development. He travels the globe, consulting as a lead manager for software projects and teams. A graduate of McGill University’s School of Computer Science, he spent five years at Microsoft, developing and managing developers on the Visual Basic, Visual J++, and .NET Windows Forms teams.
Table of Contents
Introduction
PART I: LEARNING TO WALK
Chapter 1 Getting Started
Installing Node.jsRunning 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
TypesType Comparisons and Conversions
Functions
Language Constructs
Classes, Prototypes, and Inheritance
Errors and Exceptions
Some Important Node.js Globals
Chapter 3 Asynchronous Programming
The Old Way of Doing ThingsThe 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
PART II: LEARNING TO RUN Chapter 4 Writing Simple Applications
Your First JSON ServerNode Pattern: Asynchronous Loops
Learning to Juggle: Handling More Requests
More on the Request and Response Objects
Increased Flexibility: GET Params
Modifying Things: POST Data
Chapter 5 Modules
Writing Simple Modulesnpm: The Node Package Manager
Consuming Modules
Writing Modules
A Module So Common It Should Be Built In
Chapter 6 Expanding Your Web Server
Serving Static Content with Streams Assembling Content on the Client: Templates
PART III: WRITING WEB APPLICATIONS Chapter 7 Building Web Applications with Express
Installing Express Routing and Layers in Express
REST API Design and Modules
Additional Middleware Functionality
Chapter 8 Databases I: NoSQL (MongoDB)
Setting Up MongoDB Structuring Your Data for MongoDB
Understanding the Basic Operations
Updating Your Photo Albums App
Recapping the App Structure
Chapter 9 Databases II: SQL (MySQL)
Getting ReadyCreating a Schema for the Database
Basic Database Operations
Adding Authentication to the Application
Resource Pooling
PART IV: GETTING THE MOST OUT OF NODE.JS Chapter 10 Deployment and Development
Deployment Multiprocessor Deployment: Using a Proxy
Virtual Hosting
Securing Your Projects with HTTPS/SSL
Multiplatform Development
Chapter 11 Command-Line Programming
Running Command-Line Scripts Working with Files Synchronously
Interacting with the User: stdin/stdout
Working with Processes
Chapter 12 Testing
Choosing a Framework Writing Tests
RESTful API Testing