DeveloperBreeze

Access Command-line Arguments

// Access command-line arguments excluding the first two elements (node and script path)
const args = process.argv.slice(2);

// Log the command-line arguments
console.log('Command-line arguments:', args);

Continue Reading

Discover more amazing content handpicked just for you

Tutorial

Build a Custom Rate Limiter in Node.js with Redis

This isn’t just a quick fix—it’s a deep dive into:

  • Atomic operations with Redis
  • Manual request tracking logic
  • Flexibility to customize based on business rules

Apr 04, 2025
Read More
Tutorial
javascript css +1

Building a Real-Time Chat Application with WebSockets in Node.js

node server.js

http://localhost:3000/

Aug 03, 2024
Read More
Code
php

JWT Token Creation and Verification in Node.js using 'jsonwebtoken'

No preview available for this content.

Jan 26, 2024
Read More
Code
javascript

Simple HTTP Server in Node.js

No preview available for this content.

Jan 26, 2024
Read More
Code
javascript

Read and Write Files in Node.js using 'fs' module

No preview available for this content.

Jan 26, 2024
Read More
Code
javascript

Simple RESTful API in Node.js using Express

No preview available for this content.

Jan 26, 2024
Read More
Code
javascript

Date Manipulation and Sum Calculation

No preview available for this content.

Jan 26, 2024
Read More
Code
javascript

Set and Access Environment Variable

No preview available for this content.

Jan 26, 2024
Read More
Code
javascript

Event Emitter using 'events' module

No preview available for this content.

Jan 26, 2024
Read More
Code
javascript

Construct File Path using 'path' module

No preview available for this content.

Jan 26, 2024
Read More
Code
javascript

Basic Authentication using 'express-basic-auth' middleware

// Import required modules
const express = require('express');
const app = express();
const basicAuth = require('express-basic-auth');

// Define a user for basic authentication
const users = { 'username': 'password' };

// Use express-basic-auth middleware for authentication
app.use(basicAuth({ users }));

// Define a route accessible only to authenticated users
app.get('/secure', (req, res) => {
  res.send('Authenticated route');
});

Jan 26, 2024
Read More
Code
javascript

Create and Print Buffer

No preview available for this content.

Jan 26, 2024
Read More
Code
javascript

Hashing Password with SHA-256 using 'crypto' module

No preview available for this content.

Jan 26, 2024
Read More
Code
javascript

Parse URL and Query Parameters

No preview available for this content.

Jan 26, 2024
Read More
Code
javascript

Execute Shell Command using 'child_process' module

No preview available for this content.

Jan 26, 2024
Read More
Code
javascript

File Stream Copy using 'fs' module

No preview available for this content.

Jan 26, 2024
Read More
Code
javascript

Simple WebSocket Server using 'ws' library

No preview available for this content.

Jan 26, 2024
Read More

Discussion 0

Please sign in to join the discussion.

No comments yet. Start the discussion!