Navigate Node

By Ev Bogue

Over the past five years I've learned how to program in Node. While I still consider myself a beginner at programming in Node, I've taken extensive notes.

Navigate Node contains my notes on programming in Node.

Node is a style of programming in JavaScript. In the beginning JavaScript was restricted to the browser window. Thanks to Node, JavaScript was liberated over the last few years. Now you can program with Node on your command line. This has opened up a world of JavaScript possibilities on the command line, desktop, server-side, and also allows you to compile isomorphic JavaScript that punts your server-side code back into the browser where it all began.

In my opinion the state of documentation in the Node world is dismal. The last time I was in a bookstore I found just a single Node book, and it was published back in 2013. I flipped it open and saw it was about Node version 0.8.6. Node, as of December 2017 is at version 9.3.0-1. There is not a single print Node book that I know of that covers modern coding practices with Node. That's because the Node ecosystem is moving, changing, growing, evolving. Hence the need for navigation.

Programmers must evolve with the Node ecosystem, but unfortunately print books cannot evolve. Print books are stuck in the physical realm, where it takes immense amounts of effort to change anything. Digital books, on the other hand, exist in the very same realm that Node exists in: within computers. In the digital world you can learn faster, make things faster, and of course break things and get errors faster.

This is my attempt at writing a modern Node book. I believe Node is the most minimal of programming languages. It's minimal because of its module system. With the Node module system you can abstract your program into many minimal modules. You can also lean heavily on many minimal modules that have already been written, tested, and deployed in production by programmers who may or may not be smarter than you.

Because of the many minimal modules ecosystem around Node we can write a simple static web server with only a few lines of code. This is a static web server written using the Koa.js web framework

    var app = require('koa')();
    var serve = require('koa-static');



Running this minimal application using a Node stack exposes any files you have in the folder you've written the application to the web. If you deploy this application to a VPS (virtual private server) in combination with a folder of html files, you can serve a static website with only four lines of JavaScript.

Go ahead. Try it.

Navigate Node is not about rebuilding the work other people have done. It's not about learning how to do things the brutal way.

The goal of Navigate Node is to teach you how to do the most with Node in the least amount of code. Sometimes that may mean a few lines of simple JavaScript. Here's what I think. When you're learning the goal is to accomplish cool things quickly, with the least amount of effort. While we're learning we'll leave the more difficult tasks of creating amazing distributed applcations with complex APIs to the seasoned professionals.

Seasoned professionals don't have time to write Node books; they've got jobs, gigs, and difficult programming challenges to overcome.

Here's why I'm writing a Node book while I'm still learning how to be a master at Node programming. I might not be a genius at coding (indeed, I am not), but I credit myself with having a talent for recording how to do things when I learn how to do them.

If you're new to Node, or feel that you have room to improve your skills, then Navigate Node is for you.

Navigate Node starts off with the basics and drops you into more advanced topics. In some cases the book offers ways to do the same thing multiple ways, so you can choose the right approach for you.

I've attempted to keep each chapter brief, and the lines of code involved with the examples to a minimum. This way you can quickly write basic Node applications that compile, and do actual useful things with a webserver within each chapter. As I've learned Node over the past five years, I believe this approach to learning it to be the best way to learn. As you move through Navigate Node, trying each of the examples yourself, you'll begin to gain the confidence to build longer and more robust applications on your own by piecing together the many minimal modules available to you in the Node ecosystem.

While Navigate Node is a work in progress I'm open to hearing what chapters you'd like to see included in the book. If you're trying to puzzle out something that isn't available in the book now or after you've purchased, feel free to drop me an email at ev@evbogue.com and I'll see about adding the solution to the problem you're trying to solve if I know or can learn how to solve it myself.

Navigate Node culminates with a seven chapter series on how to build your own blog using a series of Node modules and a minimal amount of code. The goal for this part of the book is to get you to the point where you have the confidence to write your own fully functional blog in Node. Next, you can deploy the blog you've built to a domain name on the Internet and tell everyone about how you did it!

As you start working through Navigate Node, let me remind you of something Arthur C Clark said: any sufficiently advanced program is indistinguishable from magic. However, the actual work of programming can be quite hard, frustrating, brain numbing and tedious.

My goal with this book is to help you get ahead at programming Node faster. Once you get to the end of the book you should have a nuanced understanding of how the Node ecosystem works and what you can do with it. This doesn't mean you'll be able to do amazing things that haven't been covered in the book, but it will mean that you'll have a solid knowledge of the topic grounded in the notes that I've taken on how to program and that I've now put into Navigate Node.

The button above will take you to Paypal, where you can complete your purchase with a debit or credit card. Once payment is completed, you'll receive an email that contains a secret link to the book. If you want to pay with Bitcoin, contact me.

Ev Bogue