Category Archives: Book

Practical Node.js, 2nd Edition: Colored Print Book is Ready

The Practical Node.js, 2nd Edition print book is finally ready. It turned out the biggest thickest book I ever wrote (500+ pages). Practical Node, 2nd Ed. is even thicker than React Quickly.

My publisher Apress did a great job with design. They printed in color which means readers can see colored code, colored pictures and colored everything. This is never heard of in tech publishing (in my humble opinion).

Practical Node is the same book that was the top seller on Amazon when you search for “node.js” for many many months. Now this book is updated and better with THREE more new chapters and all code in ES6+.

Practical Node.js, 2nd Edition

Practical Node.js, 2nd Edition

I got only 10 free author copies from the publisher but they are awesome (pics below). If you want to buy from Amazon, here’s the link: You can also buy digital and print directly from Apress:

If you prefer to free books, then here’s the (unedited) “open source” manuscript on GitHub (also code is colored): I’m sure you can find PDF on torrents too.

Give your eyes some rest from screens and get yourself a nice print Node book for holidays!


Full Stack JavaScript

My new book Full Stack JavaScript (my 4th traditionally-published book) comes with a series of screencast videos for better immersion in a wonderful and mesmerizing world of Node.js, Backbone and MongoDB. It’s a one thing to read through the text and another to follow up with dynamic videos which walk you through the book’s projects.

Full Stack JavaScript

Full Stack JavaScript

The videos and the source code are open source, meaning they are publicly available. Therefore, you don’t have to buy a book—you can just watch the 14 videos on YouTube (playlist) and go through the code on GitHub (repository).

Continue reading

5 Hacks to Getting the Job of Your Dreams to Live a Happier and Healthier Life

5 Hacks to Getting The Job of Your Dreams

Getting a job of your dreams might be easier than you think. Apply these five hacks and see for yourself.

Study after study has showed that being satisfied and happy at a job is paramount for a healthy, productive and long life. In other words, if you’re miserable at a job, then other areas of your life will suffer as well: personal life, health, spirituality, family, friends, etc.

Here are the 5 Hacks that will help you to get your dream job:

  1. Write a book
  2. Create a strong web presence
  3. Boost your LinkedIn profile
  4. Speak at a conference
  5. Take a MOOC (Massive open-online course)

You can use these five hacks to get the job of your dreams in pretty much any industry or field. And most of them will cost you nothing or close to nothing!

Of course, any of these hacks are useless if you don’t know what your dream job is. If you are not sure, then before reading any further, answer these questions:

  • How much money do you want to make in a year or an hour?
  • How much maximum commute can you tolerate (e.g., 30min, 1hr)?
  • Do you like a certain area of your city?
  • Do you want to work with certain technologies or in a particular industry?
  • What kind of benefits do you want to have (ideally)?

Go crazy with these questions, let your fantasies go wild… yet remain realistic, otherwise you won’t believe it’s possible.

We are not separate people when we go to work and come back from it. We cannot separate our jobs from the rest of our lives. The quality of your job and its factors are in direct proportion to your happiness and physical and mental health.

So let’s start with my favorite hack.

Continue reading

Pro Express.js: Master Express.js—The Node.js Framework For Your Web Development Is Out

Pro Express.js: Master Express.js—The Node.js Framework For Your Web Development Is Out

The long-anticipated Express.js manual is ready and was sent to to print at this week (December 24, 2014). To summarize the book, Pro Express.js: Master Express.js—The Node.js Framework For Your Web Development is all about understanding Express.js and building web apps with this framework and its middleware. Spend two minutes to read this post, to know how you can benefit from this valuable resource and the release.

Pro Express.js: Master Express.js—The Node.js Framework For Your Web Development Is Out

Pro Express.js: Master Express.js—The Node.js Framework For Your Web Development Is Out

Becoming a Better Node.js Developer

If you an intermediate or advanced beginner Node.js developer and want to become better at this cool, new technology, then you have lots of questions about the best practices and patterns. Most likely you’ve encountered Express.js, and you wish you knew more about useful settings and options to configure Express.js and its middleware.

The reason why I know these things is that, before I became proficient with Node.js and Express.js, I was a beginner just like you. Also, I’ve been in a position when I needed to learn Express.js quickly. In those sad moments, I was flat out miserable and often had to read the source code for the lack of a good documentation and examples. I wish I had Pro Express.js with me back then to explain the mechanisms in plain English, and provide inspiring code patterns that I could re-use in my projects. That’s why I’m confident that Pro Express.js will be great for intermediate Node.js developers (and advanced-beginners).

Pro Express.js can solve your pains and problems by providing the following benefits:

Continue reading

URL Parameters and Routing in Express.js

Parameters and Routing in Express.js

TL;DR: This post is about URL parameters and routing in Express.js, and it’s an excerpt (Chapter 6) from my new book Pro Express.js: Master Express.js—The Node.js Framework For Your Web Development. The book was released this week (~December 24, 2014), but we have a great limited-time offer for you which will be announced on Sunday, December 28, 2014 on This post is the last post in the series of excerpts from Pro Express.js with other posts as follow: Error Handling and Running an Express.js App, Express.js Security Tips, LoopBack 101: Express.js on Steroids, Sails.js 101 and Secret Express.js Settings.

To review, the typical structure of an Express.js app fig(which is usually a server.js or app.js file) roughly consists of these parts, in the order shown:

  1. Dependencies : A set of statements to import dependencies

  2. Instantiations : A set of statements to create objects

  3. Configurations : A set of statements to configure system and custom settings

  4. Middleware : A set of statements that is executed for every incoming request

  5. Routes : A set of statements that defines server routes, endpoints, and pages

  6. Bootup : A set of statements that starts the server and makes it listen on a specific port for incoming requests

This chapter covers the fifth category, routes and the URL parameters that we define in routes. These parameters, along with the app.param() middleware, are essential because they allow the application to access information passed from the client in the URLs (e.g., books/proexpressjs). This is the most common convention for REST APIs. For example, the route will use the value of 521eb002d00c970200000003 as the post ID.

Parameters are values passed in a query string of a URL of the request. If we didn’t have Express.js or a similar library, and had to use just the core Node.js modules, we’d have to extract parameters from an HTTP.request object via some require('querystring').parse(url) or require('url').parse(url, true) function “trickery.”

Let’s look closer at how to define a certain rule or logic for a particular URL parameter.

Continue reading

Error Handling and Running an Express.js App

Error Handling and Running an Express.js App

TL;DR: This text is an excerpt (Chapter 9) from Pro Express.js: Master Express.js—The Node.js Framework For Your Web Development. The book will be released next week (December 24, 2014), and we’ll announce a great limited-time offer on it on Sunday, December 28, 2014. So stay tuned… and happy Holidays!!!

Good web applications must have informative error messages to notify clients exactly why their request has failed. Errors might be caused either by the client (e.g., wrong input data) or by the server (e.g., a bug in the code).

The client might be a browser, in which case the application should display an HTML page. For example, a 404 page should display when the requested resource is not found. Or the client might be another application consuming our resources via the REST API. In this case, the application should send the appropriate HTTP status code and the message in the JSON format (or XML or another format that is supported). For these reasons, it’s always the best practice to customize error-handling code when developing a serious application.

In a typical Express.js application, error handlers follow the routes. Error handling deserves its own section of the book because it’s different from other middleware. After the error handlers, we’ll cover the Express.js application methods and ways to start the Express.js app. Therefore, the major topics of this chapter are as follows:

  • Error handling
  • Running an app

Continue reading

Express.js Security Tips

Express.js Security Tips


This text is part of my new book Pro Express.js: Master Express.js—The Node.js Framework For Your Web Development [Apress, 2014]. Security is important, that’s why I decided to publish this chapter on my blog. The book will be released very soon.

The set of tips in this chapter deals with security in Express.js applications. Security is often a neglected topic that is deferred until the last minute before the release. Obviously, this approach of treating security as an afterthought is prone to leaving holes for attackers. A better approach is to consider and implement security matters from the ground up.
Continue reading

Job Security is Dead But There Is a Way

The Best Way to Never Worry About Job Security Again

There is no such thing as a job security. You can trust my word on this, because I worked for one of the most stable employers in the world, the U.S. federal government, during 2007–2008, and had seen a lot of bright software engineers, analysts, technical writers, quality assurance engineers, and project managers let go due to the market downturn and budget cuts. Startups and private corporations are even more brutal. They won’t even give you a two-week notice! I know of a company that fired its lead software engineer with just ONE hour of notice… poor fellow didn’t expect it at all when he was coming to work in the morning just to go back home for the rest of the day right away!

Continue reading