Node.js: The Maximum Size Allowed for Strings/Buffers

November 29, 2021 Guest Contributor

Buffers and strings in Node.js are limited in size. The actual maximum size of a buffer or a string changes across platforms and versions of Node.js. You can check yours as follows: Here’s my output: Further…

4 Ways to Read JSON Files in Node.js

November 23, 2021 A Goodman

This article walks you through a bunch of different ways to read JSON files in Node.js. Without any further ado, let’s get our hands dirty by writing some code. Getting Started This is the sample JSON…

Node.js: Using __dirname and __filename with ES Modules

November 18, 2021 A Goodman

If you’re building a Node.js application with ES modules instead of CommonJS modules (“import” instead of “require”, in simpler terms), you have to do something before writing __filename and __direname in your code. The Problem In…

Tweaking a Node.js Core Module

November 18, 2021 Napoleon

The example below shows you how to change the behavior of a Node.js core module by modifying or extending it. What we are going to do should not appear in serious products but might be somehow…

Node.js: Getting User Input from Console (2 approaches)

November 18, 2021 A Goodman

This article walks you through a couple of different ways to get user input from the console in a Node.js program. The first approach is to do things from scratch with only built-in features of Node.js….

Node.js: Use Async Imports (Dynamic Imports) with ES Modules

November 17, 2021 Pennywise

Overview Nowadays, many modern Node.js applications use ES modules (that go with the import keyword) instead of CommonJS modules (that go with the require keyword). When working with ES modules, there might be scenarios where you…

How to Install Node.js on Ubuntu 20.x/21.x/22.x

October 4, 2022 A Goodman

This article shows you how to install Node.js and NPM on Ubuntu 20.04 (Focal Fossa), Ubuntu 20.10 (Groovy Gorilla), Ubuntu 21.04 (Hirsute Hippo), Ubuntu 21.10 (Impish Indri), Ubuntu 22.04 (Jammy Jellyfish), and Ubuntu 22.10 (Kinetic Kudu)….

Node.js: Generate Images from Text Using Canvas

November 10, 2021 A Goodman

The example below shows you how to programmatically generate images from text in Node.js by using the canvas library. Example Here’s the image we are going to “draw” with code: The code 1. Install the library:…

Node.js: Reading and Parsing Excel (XLSX) Files

November 10, 2021 A Goodman

This article shows you how to read and extract content from an Excel (.xlsx) file by using Node.js. Without any further ado, let’s get our hands dirty and start coding. Getting Things Ready We are going…

Node.js: How to Ping a Remote Server/ Website

July 12, 2022 A Goodman

This article shows you a couple of different ways to programmatically ping a remote server or a website from within your Node.js application (to get some network information like latency, IP address, …). In the first…

Express + TypeScript: Extending Request and Response objects

July 12, 2022 Augustus

This article shows you how to add new properties to an Express request object (we often deal with this task when working with middleware) or an Express response (not too common but may be necessary in…

Node + Mongoose + TypeScript: Defining Schemas and Models

July 12, 2022 Augustus

This article walks you through a concise and straight-to-the-point example of declaring schemas and defining models with Mongoose and TypeScript. Without any further ado (e.g, talking about the history of Node.js or explaining what MongoDB is…

1 2 3 4 5 6