SlingAcademy

Node.js

Node.js is a JavaScript runtime that allows for server-side scripting, enabling the development of scalable network applications using a non-blocking, event-driven architecture.

Node.js Streams: Tutorial & Examples

Updated: Dec 28, 2023

Streams are an essential feature in Node.js that allow you to read or write data in a continuous flow. In Node.js, streams are instances of the EventEmitter class which facilitate handling of I/O operations. They are particularly useful......

How to Deploy a Node.js App on Google App Engine

Updated: Dec 28, 2023

Overview Deploying a Node.js application to Google App Engine can be a straightforward process, which involves setting up a Google Cloud project, preparing the Node.js application, and deploying it using the Google Cloud SDK. This......

How to send HTTP requests in Node.js with node-fetch

Updated: Dec 28, 2023

Overview In this tutorial, we will explore how to use the node-fetch library, a Node.js module that enables you to perform HTTP requests in a way that is highly reminiscent of the native Fetch API available in browsers. This library......

Using module.exports in Node.js

Updated: Dec 28, 2023

Overview In Node.js, modules are the building blocks of any application. They help in breaking down complex code into manageable pieces which can be developed, maintained, and reused efficiently. One of the fundamental aspects of......

How to Run Multiple NPM Scripts Sequentially

Updated: Dec 28, 2023

Learn how to run multiple npm scripts sequentially through 3 different techniques. Solution 1: Using && Operator Description: The most common way to run NPM scripts sequentially is to use the && operator to chain the......

How to Run Multiple NPM Scripts in Parallel

Updated: Dec 28, 2023

This concise, practical article will walk you through some different approaches to running multiple npm scripts in parallel. Using npm-run-all Solution description: npm-run-all is a CLI tool to run multiple npm-scripts in parallel......

Fixing Node.js npm ERR! code ELIFECYCLE Error

Updated: Dec 28, 2023

The ELIFECYCLE error is a common issue in Node.js that developers encounter when running npm scripts. This error typically indicates that a script defined in the package.json file has exited with an error or has been terminated by a......

Fixing Node.js SyntaxError: Unexpected token import

Updated: Dec 28, 2023

The ‘Unexpected token import’ error in Node.js occurs when you’re trying to use the ES6 import syntax without the proper configuration. Node.js versions below 13.2.0 don’t support ES6 imports by default and need to......

How to set up TypeScript for a Node.js project

Updated: Dec 02, 2023

TypeScript can help you write more reliable and maintainable code for your Node.js projects. TypeScript code needs to be compiled into JavaScript before it can be executed by Node.js. You can use a tool called tsc (TypeScript compiler) to......

Node.js: Get domain, hostname, and protocol from a URL

Updated: Dec 02, 2023

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