DeveloperBreeze

Nodejs Programming Tutorials, Guides & Best Practices

Explore 16+ expertly crafted nodejs tutorials, components, and code examples. Stay productive and build faster with proven implementation strategies and design patterns from DeveloperBreeze.

Build a Custom Rate Limiter in Node.js with Redis

Tutorial April 04, 2025

Protect your API from abuse and learn how rate limiting works under the hood.

When developing web apps or APIs, it’s critical to prevent users from overwhelming your server. That’s where rate limiting comes in. In this guide, we’ll build a custom rate limiter in Node.js using Redis—no libraries, no magic, just code you control and understand.

Understanding `crypto.randomBytes` and `ethers.randomBytes`: A Comparison

Tutorial October 24, 2024

    const crypto = require('crypto');
    const randomBytes = crypto.randomBytes(32);
    console.log(randomBytes.toString('hex')); // Prints a 32-byte random hex string
  • ethers.randomBytes:
  • Library: ethers.randomBytes is provided by the ethers.js library, a popular JavaScript library for Ethereum development. You need to install and include ethers.js as a dependency in your project to use this function.
  • Usage: This function optionally takes the number of bytes you want to generate. If no argument is passed, it defaults to generating 32 bytes. It returns a Uint8Array of random bytes.
  • Example:

Working with `BigNumber` in ethers.js: A Guide for Version 6

Tutorial October 24, 2024

  const num = BigNumber.from('12345');
  • From a Hexadecimal String:

Connecting a Node.js Application to an SQLite Database Using sqlite3

Tutorial October 24, 2024

Run app.js to insert the data:

Connected to the SQLite database.
Table "accounts" created or already exists.
A row has been inserted with rowid 1

PM2 Cheatsheet

Cheatsheet October 14, 2024

   pm2 deploy ecosystem.config.js production
   pm2 deploy ecosystem.config.js production revert 1