Node.js

javascript css html

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...

php

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...

javascript

Simple HTTP Server in Node.js

This Node.js code creates a basic HTTP server using the 'http' module. The server responds with...

javascript

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...

javascript

Simple RESTful API in Node.js using Express

This Node.js code sets up a simple RESTful API using Express. It defines a route...

javascript

Date Manipulation and Sum Calculation

This Node.js code showcases the usage of Moment.js to get the current date and time and Lodash...

javascript

Access Command-line Arguments

This Node.js code accesses and logs the command-line arguments passed to the script, excluding...

javascript

Set and Access Environment Variable

This Node.js code sets an environment variable (API_KEY) using process.env and then logs the...

javascript

Event Emitter using 'events' module

This Node.js code demonstrates using the 'events' module to create an EventEmitter instance,...

javascript

Construct File Path using 'path' module

This Node.js code uses the 'path' module to construct a file path using path.join. The resulting...

javascript

Basic Authentication using 'express-basic-auth' middleware

This Express.js code sets up basic authentication using the 'express-basic-auth' middleware. It...

javascript

Create and Print Buffer

This Node.js code creates a Buffer from the string 'Hello, Node.js!' and prints the content of...

javascript

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')...

javascript

Parse URL and Query Parameters

This Node.js code demonstrates parsing a URL, extracting query parameters using the 'url' and...

javascript

Execute Shell Command using 'child_process' module

This Node.js code utilizes the 'child_process' module to execute the 'ls -l' shell command. It...