Building a Real-Time Chat Application with WebSockets in Node.js
Learn how to build a real-time chat application using Node.js and WebSockets. This tutorial...
JWT Token Creation and Verification in Node.js using 'jsonwebtoken'
This Node.js code uses the 'jsonwebtoken' module to create a JWT token with a payload and set...
Simple HTTP Server in Node.js
This Node.js code creates a basic HTTP server using the 'http' module. The server responds with...
Read and Write Files in Node.js using 'fs' module
This Node.js code demonstrates reading content from a file ('file.txt') and writing to a new...
Simple RESTful API in Node.js using Express
This Node.js code sets up a simple RESTful API using Express. It defines a route...
Date Manipulation and Sum Calculation
This Node.js code showcases the usage of Moment.js to get the current date and time and Lodash...
Access Command-line Arguments
This Node.js code accesses and logs the command-line arguments passed to the script, excluding...
Set and Access Environment Variable
This Node.js code sets an environment variable (API_KEY) using process.env and then logs the...
Event Emitter using 'events' module
This Node.js code demonstrates using the 'events' module to create an EventEmitter instance,...
Construct File Path using 'path' module
This Node.js code uses the 'path' module to construct a file path using path.join. The resulting...
Basic Authentication using 'express-basic-auth' middleware
This Express.js code sets up basic authentication using the 'express-basic-auth' middleware. It...
Create and Print Buffer
This Node.js code creates a Buffer from the string 'Hello, Node.js!' and prints the content of...
Hashing Password with SHA-256 using 'crypto' module
This Node.js code uses the 'crypto' module to create a SHA-256 hash of a password ('mypassword')...
Parse URL and Query Parameters
This Node.js code demonstrates parsing a URL, extracting query parameters using the 'url' and...
Execute Shell Command using 'child_process' module
This Node.js code utilizes the 'child_process' module to execute the 'ls -l' shell command. It...