My Blog

My WordPress Blog

My Blog

My WordPress Blog

1. Tutorial

Node.js StringDecoder

The Node.js StringDecoder is used to decode buffer into string. It is similar to buffer.toString() but provides extra support to UTF. You need to use require(‘string_decoder’) to use StringDecoder module. Node.js StringDecoder Methods StringDecoder class has two methods only. Method Description decoder.write(buffer) It is used to return the decoded string. decoder.end() It is used to […]

Node.js Path

The Node.js path module is used to handle and transform files paths. This module can be imported by using the following syntax: Syntax: Node.js Path Methods Let’s see the list of methods used in path module: Index Method Description 1. path.normalize(p) It is used to normalize a string path, taking care of ‘..’ and ‘.’ […]

Node.js File System (FS)

In Node.js, file I/O is provided by simple wrappers around standard POSIX functions. Node File System (fs) module can be imported using following syntax: Syntax: Node.js FS Reading File Every method in fs module has synchronous and asynchronous forms. Asynchronous methods take a last parameter as completion function callback. Asynchronous method is preferred over synchronous […]

Node.js TLS/SSL

What is TLS/SSL TLS stands for Transport Layer Security. It is the successor to Secure Sockets Layer (SSL). TLS along with SSL is used for cryptographic protocols to secure communication over the web. TLS uses public-key cryptography to encrypt messages. It encrypts communication generally on the TCP layer. What is public-key cryptography In public-key cryptography, […]

Node.js Crypto

The Node.js Crypto module supports cryptography. It provides cryptographic functionality that includes a set of wrappers for open SSL’s hash HMAC, cipher, decipher, sign and verify functions. What is Hash A hash is a fixed-length string of bits i.e. procedurally and deterministically generated from some arbitrary block of source data. What is HMAC HMAC stands […]

Node.js Net

Node.js provides the ability to perform socket programming. We can create chat application or communicate client and server applications using socket programming in Node.js. The Node.js net module contains functions for creating both servers and clients. Node.js Net Example In this example, we are using two command prompts: server: File: net_server.js Open Node.js command prompt […]

Node.js DNS

The Node.js DNS module contains methods to get information of given hostname. Let’s see the list of commonly used DNS functions: Node.js DNS Example 1 Let’s see the example of dns.lookup() function. File: dns_example1.js Open Node.js command prompt and run the following code: Node.js DNS Example 2 Let’s see the example of resolve4() and reverse() […]

Scroll to top