Getting Date and Time in Node.js
In Node.js date and time are handled with the Javascript Date object. It is loaded by default and requires no import of modules.
Creating and Starting a Web Server in Node.js
The built-in http / https modules can be used to create a HTTP / HTTPS server in Node.
Making Synchronous HTTP Requests in Node.js
A synchronous HTTP request will wait for the request to be made and full response to come. Synchronous HTTP requests are possible in Node.js with the use of Javascript Promises, async and await.
Making GET Requests in Node.JS
HTTP GET requests can be made through Node using the http module.
Making POST Requests in Node.JS
This tutorial discusses how to send a HTTP POST request from Node using the http module.
Running Cron Jobs in Node.js
Cron jobs are important when some script is required to be executed at a fixed time over and over again. In Node.js cron jobs can be setup using an external module known as node-cron.
Using the Reviver Function in JSON.parse
JSON.parse accepts an optional second parameter - the reviver function. The purpose of this function is to modify the result before returning, and can be thought of as filter function.
Reading JSON in Node.js
The standard built-in Javascript object JSON can be used to parse json strings.
Reading XML in Node.js
The "xml2js" module can be used to read XML files in Node. In case if the file is huge, the "node-xml-stream" module can be used to read XML as a stream.
How to Crop Images in Node.js
The Sharp module can be used to crop an image in Node.
Resizing Images in Node.js
The Sharp Node.js module can be used to resize large images of any common file-type to web-friendly images of any dimension. It claims to be multiple times faster than ImageMagick and GraphicsMagick.
Node.js - Reading a File Line by Line
In some cases you may need to read a file, line by line, asynchronously. This can be done by the Readline module that reads data from a readable stream and emits an event after reading each line.
Getting POST Parameters in Node.js
POST parameters can be read with the querystring module. In case of a multipart/form-data POST request, external modules are required.
Getting URL Parameters in Node.js
You can get url parameters in Node by importing the built-in "url" module. This module gives access to the URL and URLSearchParams objects.
Routing in Node.js (without framework)
Frameworks such as ExpressJS makes routing quite easy. But initially it is important to understand how routing works in Node.js, and not to jump to ExpressJS straightaway.
How to Write a REST API Class for Node.js
While implementing an API with Node.js, it is better to write it as a class, create a module, and import the module in the main Node.js script. This tutorial describes general coding guidelines how you can create such a class.
Javascript Promises - Understanding Chaining and Error Handling
Javascript Promises are quite simple to start with, but confusions arise when Promises are chained. This tutorial focuses on the return values of then() and catch(), which are crucial to understanding the process.