Learning Node(English, Undefined, Powers Shelley)
Quick Overview
Product Price Comparison
Take your web development skills from browser to server with Node—and learn how to write fast, highly scalable network applications on this JavaScript-based platform. With this hands-on guide, you’ll quickly master Node’s core fundamentals, gain experience with several built-in and contributed modules, and learn the differences and parallels between client- and server-side programming. Get up to speed on Node’s event-driven, asynchronous I/O model for developing data-intensive applications that are frequently accessed but computationally simple. If you’re comfortable working with JavaScript, this book provides numerous programming and deployment examples to help you take advantage of server-side development with Node. Explore Node’s unique approach to asynchronous development Build sample Node applications with the Express framework and Connect middleware Use NoSQL solutions such as Redis and MongoDB—and explore Node’s relational database modules Work with PDF files, serve HTML5 media, and create graphics with Canvas Set up bidirectional communication between browser and server with WebSockets Learn in-depth practices for debugging and testing your applications Deploy Node applications in the cloud or on your own system "Learning Node will make it easy for someone from any programming background to get a grip on Node.js and build amazing projects." —Tom Hughes-Croucher, co-author of Node: Up and Running (O’Reilly) About the Author Shelley Powers has been working with, and writing about, web technologies--from the first release of JavaScript to the latest graphics and design tools--for more than 12 years. Her recent O'Reilly books have covered the semantic web, Ajax, JavaScript, and web graphics. She's an avid amateur photographer and web development aficionado, who enjoys applying her latest experiments on her many web sites. Table of Contents Chapter 1 Node.js: Up and Running Setting Up a Node Development Environment Node: Jumping In Asynchronous Functions and the Node Event Loop Benefits of Node Chapter 2 Interactive Node with REPL REPL: First Looks and Undefined Expressions Benefits of REPL: Getting a Closer Understanding of JavaScript Under the Hood Multiline and More Complex JavaScript Stuff Happens—Save Often Chapter 3 The Node Core Globals: global, process, and Buffer The Timers: setTimeout, clearTimeout, setInterval, and clearInterval Servers, Streams, and Sockets Child Processes Domain Resolution and URL Processing The Utilities Module and Object Inheritance Events and EventEmitter Chapter 4 The Node Module System Loading a Module with require and Default Paths External Modules and the Node Package Manager Finding Modules Creating Your Own Custom Module Chapter 5 Control Flow, Asynchronous Patterns, and Exception Handling Promises, No Promises, Callback Instead Sequential Functionality, Nested Callbacks, and Exception Handling Asynchronous Patterns and Control Flow Modules Node Style Chapter 6 Routing Traffic, Serving Files, and Middleware Building a Simple Static File Server from Scratch Middleware Routers Proxies Chapter 7 The Express Framework Express: Up and Running The app.js File in More Detail Error Handling A Closer Look at the Express/Connect Partnership Routing Cue the MVC Testing the Express Application with cURL Chapter 8 Express, Template Systems, and CSS The Embedded JavaScript (EJS) Template System Using a Template System (EJS) with Express The Jade Template System Incorporating Stylus for Simplified CSS Chapter 9 Structured Data with Node and Redis Getting Started with Node and Redis Building a Game Leaderboard Creating a Message Queue Adding a Stats Middleware to an Express Application Chapter 10 Node and MongoDB: Document-Centric Data The MongoDB Native Node.js Driver Implementing a Widget Model with Mongoose Chapter 11 The Node Relational Database Bindings Getting Started with db-mysql Native JavaScript MySQL Access with node-mysql ORM Support with Sequelize Chapter 12 Graphics and HTML5 Video Creating and Working with PDFs Accessing ImageMagick from a Child Process Properly Serving HTML5 Video with HTTP Creating and Streaming Canvas Content Chapter 13 WebSockets and Socket.IO WebSockets An Introduction to Socket.IO Configuring Socket.IO Chat: The WebSockets “Hello, World” Using Socket.IO with Express Chapter 14 Testing and Debugging Node Applications Debugging Unit Testing Acceptance Testing Performance Testing: Benchmarks and Load Tests Refreshing Code with Nodemon Chapter 15 Guards at the Gate Encrypting Data Authentication/Authorization with Passport Protecting Applications and Preventing Attacks Sandboxed Code Chapter 16 Scaling and Deploying Node Applications Deploying Your Node Application to Your Server Deployment to a Cloud Service Appendix Node, Git, and GitHub Colophon