May 13, 2018

JavaScript Async/Await: Serial, Parallel and Complex Flow

If you have experience on ASP.NET MVC then probably you are familiar with async/await keywords in C#. The same thing is now in JavaScript. Before that, Callbacks and Promises are used for asynchronous code. Async/await is built on top of promises and non blocking. The power of Async/await provides asynchronous code look like synchronous code. In this article, we will go through serial/chain and parallel flow and implement a complex flow using Async/Await.

Read Also: JavaScript Promises: Understanding Error Handling with Example

Dec 18, 2017

JavaScript: Null vs Undefined vs Undeclared

For a beginner, it is painful to understand two distinct things null & undefined in JavaScript and use them properly. I noticed many people consider and treat undeclared variable as undefined which is wrong perception. In this article, we will go through null, undefined, empty, NaN and undeclared variables and see how to handle them in different conditions.

Jul 17, 2016

Node.js: Simple TCP Server & Client and Promisify the Client

In this post, you will see an example of simple TCP server and client in traditional javascript way and in ES6 way. Node.js has net module which provides an asynchronous network API for creating stream-based TCP or IPC servers and clients. We are going to use it to implement TCP server and client. This post is updated with Node v6.11.2.

Jun 24, 2016

nvm-windows: Node or NPM not recognized after nvm installed

To manage multiple Node.js versions on windows, you are going to use and install node-windows. After installation, you run following commands to setup specific node version:

d:\>nvm install 4.7.2
d:\>nvm use 4.7.2
d:\>node --version 

and if you get following message
‘node’ is not recognized as an internal or external command, operable program or batch file.
then read this post to troubleshoot the issue.

Apr 10, 2016

Visual Studio Code: Setting Environment Variable for Tasks

Visual Studio Code (VSCode) is a lightweight, open-source code editor and available on Linux, Mac OSX, and Windows. One of the key features of Visual Studio Code is its great debugging support for Node.js (JavaScript and TypeScript) and another feature is to run Tasks(Grunt, Gulp, MSBuild…etc.) from the IDE. If you are new to VSCode, I would recommend to see following video which shows how to debug Node.js app, put break-point and use watch window, use environment variable in Visual Studio Code editor:

Oct 12, 2014

A Simple CRUD with MEAN Stack (MongoDB, ExpressJS, AngularJS, Node.js) + Sails.js on Windows

MEAN stack is a full JavaScript solution that helps you build fast, robust and maintainable production web applications using MongoDB, ExpressJS, AngularJS and Node.js.

Sails.js allows you to build custom, enterprise-grade Node.js apps using the Model-View-Controller pattern to organize your code so it is easier to maintain.

New MEAN Stack = MongoDB+ExpressJS+AngularJS+Node.js+Sails.js = MEANS stack

This article explains how to implement a simple CRUD by integrating AngularJS with Sails REST APIs.