7 best Node.js frameworks to build backend APIs in 2023
Node.js helps us build fast and high-performance backends for websites and mobile apps of all sizes. This job is made easier and more convenient thanks to the help of open-source frameworks. In this article, we will…
Top 5 best Node.js Open Source Headless CMS in 2023
Using a Node.js Headless CMS (CMS stands for Content Management System) will help you quickly build a fast and high-performance self-hosted backend for your application with many pre-made things like an admin dashboard, content CRUD (create,…
Node.js: Get domain, hostname, and protocol from a URL
By using the URL class, a built-in module of Node.js, we can easily extract domain/hostname and protocol from a given url without using any third-party package. Domain, hostname, and protocol A domain name is the address…
NPM: How To Show All Globally Installed Packages
To show all globally installed npm packages on your computer, just run the following command: Here is my output: If you want to see all global packages and their dependencies, use this: That’s it. Further reading:…
How to Generate Slugs from Titles in Node.js
This article shows you a few approaches to generating a slug from a title in Node.js. The first one is to use self-written code and the other is to use a third-party package. Introduction A slug…
3 Ways to Generate Random Strings in Node.js
This article walks you through 3 different ways to generate a random string in Node.js. The first two approaches only use self-written code and utilize the built-in functionality of Node.js. The last approach introduces to you…
Node.js: Reading content from PDF and CSV files
Introduction Node.js is non-blocking I/O so it is efficient when working with files even super-large files. PDF, which stands for Portable Document Format, is used to display text and images independently with software and hardware. CSV…
How to Resize Images using Node.js
This article walks you through a couple of different ways to programmatically resize images in Node.js. Using sharp The sharp package is fast in converting large images to smaller ones. It works well with JPEG, PNG,…
Using Axios to download images and videos in Node.js
Node.js is an asynchronous event-driven Javascript runtime that is designed to build scalable network applications. When handling files (from small images to large videos) with Node.js, you are free from the worries of dead-lock the process…
Check computer RAM size with Node.js
The built-in os module in Node provides methods that help you check your machine’s memory size: os.totalmem(): Returns the total amount of system memory in bytes. freemem(): Returns the amount of free system memory in bytes….
Get the Number of CPU Cores in Node.js
The standard module os of Node.js provides a lot of operating system-related utilities. The os.cpus() method returns an array of objects containing information about each logical CPU core. To count the number of CPU cores, we…
Excluding node_modules when using tree command on Mac
The node_modules folder is often super big and contains countless files and subdirectories. Therefore, when using the tree command to display your project file structure, you should ignore node_modules. To do so, try this: The result:…