Sams Teach Yourself Node.js in 24 Hours [NOOK Book]


In just 24 sessions of one hour or less, Sams Teach Yourself Node.js in 24 Hours will help you master the Node.js platform and use it to build server-side applications with extraordinary speed and scalability. Using this text’s straightforward, step-by-step approach, you’ll move from basic installation, configuration, and programming all the way through real-time messaging between browser and server, testing and deployment. Every lesson and case-study application builds on what you’ve already learned, giving you ...

See more details below
Sams Teach Yourself Node.js in 24 Hours

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK
  • NOOK HD/HD+ Tablet
  • NOOK
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac
  • NOOK for Web

Want a NOOK? Explore Now

NOOK Book (eBook)
$17.99 price
(Save 43%)$31.99 List Price


In just 24 sessions of one hour or less, Sams Teach Yourself Node.js in 24 Hours will help you master the Node.js platform and use it to build server-side applications with extraordinary speed and scalability. Using this text’s straightforward, step-by-step approach, you’ll move from basic installation, configuration, and programming all the way through real-time messaging between browser and server, testing and deployment. Every lesson and case-study application builds on what you’ve already learned, giving you a rock-solid foundation for real-world success!

Step-by-step instructions carefully walk you through the most common Node.js development tasks.

Quizzes and Exercises at the end of each chapter help you test your knowledge.

By the Way notes present valuable additional information related to the discussion.

Did You Know? tips offer advice or show you easier ways to perform tasks.

Watch Out! cautions alert you to possible problems and give you advice on how to avoid them.

Learn how to…

· Create end-to-end applications entirely in JavaScript

· Master essential Node.js concepts like callbacks and quickly create your first program

· Create basic sites with the HTTP module and Express web framework

· Manage data persistence with Node.js and MongoDB

· Debug and test Node.js applications

· Deploy Node.js applications to thirdparty services, such as Heroku and Nodester

· Build powerful real-time solutions, from chat servers to Twitter clients

· Create JSON APIs using JavaScript on the server

· Use core components of the Node.js API, including processes, child processes, events, buffers, and streams

· Create and publish a Node.js module

Read More Show Less

Product Details

  • ISBN-13: 9780132966269
  • Publisher: Pearson Education
  • Publication date: 9/19/2012
  • Series: Sams Teach Yourself
  • Sold by: Barnes & Noble
  • Format: eBook
  • Edition number: 1
  • Pages: 464
  • Sales rank: 913,136
  • File size: 45 MB
  • Note: This product may take a few minutes to download.

Meet the Author

George Ornbo is a web developer at pebble {code}, an agency that specializes in delivering web applications built with Node.js, Ruby, .NET, and F#. Ornbo has more than eight years of experience delivering web applications for both startups and established corporate clients. He is currently working on an online gaming startup.

Read More Show Less

Table of Contents

Introduction 1

Who Should Read This Book? 1

Why Should I Learn Node.js? 2

How This Book Is Organized 2

Code Examples 2

Conventions Used in This Book 3

Part I: Getting Started

Hour 1: Introducing Node.js 7

What Is Node.js? 7

What You Can Do with Node.js 8

Installing and Creating Your First Node.js Program 9

Summary 11

Q&A 12

Workshop 12

Exercises 13

Hour 2: npm (Node Package Manager) 15

What Is npm? 15

Installing npm 16

Installing Modules 17

Using Modules 17

How to Find Modules 19

Local and Global Installation 21

How to Find Module Documentation 22

Specifying Dependencies with package.json 23

Summary 25

Q&A 25

Workshop 26

Hour 3: What Node.js Is Used For 27

What Node.js Is Designed to Do 27

Understanding I/O 27

Dealing with Input 29

Networked I/O Is Unpredictable 33

Humans Are Unpredictable 35

Dealing with Unpredictability 37

Summary 38

Q&A 38

Workshop 39

Exercises 39

Hour 4: Callbacks 41

What Is a Callback? 41

The Anatomy of a Callback 46

How Node.js Uses Callbacks 47

Synchronous and Asynchronous Code 50

The Event Loop 53

Summary 54

Q&A 55

Workshop 55

Exercises 56

Part II: Basic Websites with Node.js

Hour 5: HTTP 59

What Is HTTP? 59

HTTP Servers with Node.js 59

HTTP Clients with Node.js 69

Summary 70

Q&A 71

Workshop 71

Exercises 72

Hour 6: Introducing Express 73

What Is Express? 73

Why Use Express? 73

Installing Express 74

Creating a Basic Express Site 74

Exploring Express 76

Introducing Jade 77

Summary 89

Q&A 89

Workshop 90

Exercises 90

Hour 7: More on Express 91

Routing in Web Applications 91

How Routing Works in Express 91

Adding a GET Route 92

Adding a POST Route 94

Using Parameters in Routes 95

Keeping Routes Maintainable 96

View Rendering 97

Using Local Variables 99

Summary 101

Q&A 101

Workshop 101

Exercises 102

Hour 8: Persisting Data 103

What Is Persistent Data? 103

Writing Data to a File 104

Reading Data from a File 105

Reading Environment Variables 106

Using Databases 108

Using MongoDB with Node.js 109

Summary 131

Q&A 131

Workshop 132

Exercises 132

Part III: Debugging, Testing, and Deploying

Hour 9: Debugging Node.js Applications 135

Debugging 135

The STDIO Module 136

The Node.js Debugger 141

Node Inspector 144

A Note on Testing 147

Summary 148

Q&A 148

Workshop 149

Exercises 149

Hour 10: Testing Node.js Applications 151

Why Test? 151

The Assert Module 152

Third-Party Testing Tools 155

Behavior Driven Development 159

Summary 167

Q&A 167

Workshop 168

Exercises 168

Hour 11: Deploying Node.js Applications 169

Ready to Deploy! 169

Hosting in the Cloud 169

Heroku 171

Cloud Foundry 176

Nodester 180

Other PaaS Providers 184

Summary 184

Q&A 184

Workshop 185

Exercises 186

Part IV: Intermediate Sites with Node.js

Hour 12: Introducting Socket.IO 189

Now for Something Completely Different 189

Brief History of the Dynamic Web 189

Socket.IO 191

Basic Socket.IO Example 191

Sending Data from the Server to Clients 194

Broadcasting Data to Clients 199

Bi-Directional Data 204

Summary 209

Q&A 209

Workshop 210

Exercises 210

Hour 13: A Socket.IO Chat Server 213

Express and Socket.IO 213

Adding Nicknames 216

Summary 235

Q&A 235

Workshop 236

Exercises 236

Hour 14: A Streaming Twitter Client 237

Streaming APIs 237

Signing Up for Twitter 238

Using Twitter’s API with Node.js 241

Extracting Meaning from the Data 244

Pushing Data to the Browser 247

Creating a Real-Time Lovehateometer 252

Summary 262

Q&A 263

Workshop 263

Exercises 264

Hour 15: JSON APIs 265

APIs 265

JSON 266

Sending JSON Data with Node.js 268

Creating JSON from JavaScript Objects 269

Consuming JSON Data with Node.js 271

Creating a JSON API with Node.js 275

Summary 285

Q&A 286

Workshop 286

Exercises 287

Part V: Exploring the Node.js API

Hour 16: The Process Module 291

What Processes Are 291

Exiting and Errors in Processes 293

Processes and Signals 293

Sending Signals to Processes 295

Creating Scripts with Node.js 297

Passing Arguments to Scripts 298

Summary 301

Q&A 302

Workshop 302

Exercises 303

Hour 17: The Child Process Module 305

What Is a Child Process? 305

Killing a Child Process 308

Communicating with a Child Process 309

The Cluster Module 311

Summary 314

Q&A 314

Workshop 314

Exercises 315

Hour 18: The Events Module 317

Understanding Events 317

Demonstrating Events Through HTTP 321

Playing Ping-Pong with Events 324

Programming Event Listeners Dynamically 326

Summary 330

Q&A 330

Workshop 331

Exercises 331

Hour 19: The Buffer Module 333

A Primer on Binary Data 333

Binary to Text 334

Binary and Node.js 335

What Are Buffers in Node.js? 338

Writing to Buffers 340

Appending to Buffers 340

Copying Buffers 342

Modifying Strings in Buffers 343

Summary 343

Q&A 343

Workshop 344

Hour 20: The Stream Module 345

A Primer on Streams 345

Readable Streams 347

Writable Streams 352

Piping Streams 353

Streaming MP3s 354

Summary 356

Q&A 356

Workshop 356

Exercises 357

Part VI: Further Node.js Development

Hour 21: CoffeeScript 361

What Is CoffeeScript? 361

Installing and Running CoffeeScript 363

Why Use a Pre-Compiler? 365

Features of CoffeeScript 366

Debugging CoffeeScript 376

Reactions to CoffeeScript 377

Summary 378

Q&A 378

Workshop 379

Exercises 379

Hour 22: Creating Node.js Modules 381

Why Create Modules? 381

Popular Node.js Modules 381

The package.json File 383

Folder Structure 384

Developing and Testing Your Module 385

Adding an Executable 388

Using Object-Oriented or Prototype-Based Programming 390

Sharing Code Via GitHub 391

Using Travis CI 392

Publishing to npm 395

Publicizing Your Module 397

Summary 397

Q&A 397

Workshop 398

Exercises 398

Hour 23: Creating Middleware with Connect 399

What Is Middleware? 399

Middleware in Connect 400

Access Control with Middleware 406

Summary 414

Q&A 414

Workshop 415

Exercises 415

Hour 24: Using Node.js with Backbone.js 417

What Is Backbone.js? 417

How Backbone.js Works 418

A Simple Backbone.js View 425

Creating Records with Backbone.js 429

Summary 432

Q&A 432

Workshop 433

Exercises 433

Index 435

Read More Show Less

Customer Reviews

Average Rating 3
( 1 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing 1 Customer Reviews
  • Posted March 25, 2014

    This was a pretty good introduction to Node.js. It definitely as

    This was a pretty good introduction to Node.js. It definitely assumes some previous JavaScript and HTML experience. If you have a working knowledge of either of either you should be able to get up to speed quite nicely with this book. It has some helpful tutorials that get you cranking out some useful web apps.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing 1 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)