Practical Node.js TOC

As the Apress team of technical reviewers and copy editors and I make progress on the Practical Node.js manuscript, the date of the publication approaches fast. Last time I checked it was June 2014. Many people ask me: how is the process compared to self-publishing? Is it worth the hassle? So far, I can say … Continue reading “Practical Node.js TOC”

Express.js 4, Node.js and MongoDB REST API Tutorial

Usually good things don’t stay the same, so our tutorial on building a JSON REST API server with Node.js and MongoDB using Mongoskin and Express.js, and testing it with Mocha and Superagent, has became a bit outdated with the new Express.js 4 version release. Here’s a brand new, revisited tutorial for Express.js 4, Node.js and … Continue reading “Express.js 4, Node.js and MongoDB REST API Tutorial”

Node.js FUNdamentals: A Concise Overview of The Main Concepts

Node.js is a highly efficient and scalable non-blocking I/O platform that was build on top of Google Chrome V8 engine and its ECMAScript. This means that most front-end JavaScript (another implementation of ECMAScript) objects, functions and methods are available in Node.js. Please refer to JavaScript FUNdamentals if you need a refresher on JS-specific basics.

NodeFramework.com: 5 New Node.js Frameworks and Express.js Todo app

Tonight I merged and closed two pull requests and made a few additions to the nodeframeworkc.com project. The updates include 5 new frameworks and Express.js Todo App which is one of the four major tutorials in my new book Express.js Guide which is coming in a next 1-2 weeks. The ebook is sent to editors and it’s the main cause for the lack of new posts at this weblog.

PHP vs. Node.js

TL;DR: PHP is not going to disappear immediately, but its positions are undermined even further by the nascent Node.js. When the Internet exploded in the 2000s, PHP was a thing all the cool kids did. It was extremely revolutionary, because: It was an interpreted language unlike C++ or Java which require the source code compilation … Continue reading “PHP vs. Node.js”

Web Frameworks for Node.js

Note: For a detailed Express.js learning resource, please check out Express.js Guide: The Most Popular Node.js Framework Manual book. TL;DR Visit nodeframework.com. Node.js is one of the fastest growing platforms, but its’s relatively young. Therefore, there’s no dominant framework like Django for Python, Rails for Ruby or Cake for PHP. Node.js frameworks niche is level … Continue reading “Web Frameworks for Node.js”

Cisco, Node.js and other musings

The hands-on Introduction to Node.js training consisted of two days and started badly: I was late driving from Oakland to San Jose through traffic, and security personnel in the lobby took extra 15 minutes to clear and escort me to the classroom. Nevertheless, attendees quickly plunged into installing Node.js, Node Package Manager and MongoDB using hard copies … Continue reading “Cisco, Node.js and other musings”

LeanPub Compilation and Sanitizing Tool Written in Node.js

LeanPub Tool — Node.js script for sanitizing and compiling a book’s manuscript. LeanPub uses multi-file book format and a special markdown markup (that confuses Marked app). I found that to convert to MS Word (for editing and other needs) this workflow is the best: 1. run leanpub-tool.js with node.js (node leanpub-tool.js) 2. open file in Marked app and convert to HTML 3. open HTML in MS Word and enjoy.

Node.js MVC: Express.js + Derby.js Hello World Tutorial

Express.js is a popular node frameworks which uses middleware concept to enhance functionality of applications. Derby is a new sophisticated Model View Controller (MVC) framework which is designed to be used with Express as it’s middleware. Derby also comes with the support of Racer, data synchronization engine, and Handlebars-like template engine among many other features.

Node.js OAuth1.0 and OAuth2.0: Twitter API v1.1 Examples

Recently we had to work on modification to accommodate Twitter API v1.1. The main difference between Twitter API v1.1 and, soon to be deprecated, Twitter API v1.0 is that most of the REST API endpoints now require user or application context. In other words, each call needs to be performed via OAuth 1.0A or OAuth 2.0 authentication.

Test-Driven Development in Node.js With Mocha

Don’t waste time writing tests for throwaway scripts, but please adapt the habit of Test-Driven Development for the main code base. With a little time spent in the beginning, you and your team will save time later and have confidence when rolling out new releases. Test Driven Development is a really really really good thing.

Asynchronicity in Node.js

One of the biggest advantages of using Node.js over Python or Ruby is that Node has a non-blocking I/O mechanism. To illustrate this let me use an example of a line in a Starbucks coffeeshop. Let’s pretend that each person standing in line for a drink is a task, and everything behind the counter — cashier, register, barista — is a server or server application. When we order a cup of regular drip coffee, like Pike, or hot tea, like Earl Grey, the barista makes it. While the whole line waits while that drink is made, and the person is charged the appropriate amount…