Sling Academy
Home/Node.js/Page 46

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

Deploy Node.js App on Ubuntu with PM2, NGINX and Let’s Encrypt

Updated: Dec 28, 2023
Deploying a Node.js application on an Ubuntu server may seem daunting, but it doesn’t have to be. In this guide, we’ll walk you through the process of deploying your app with process management via PM2, setting up NGINX as a......

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 27, 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 27, 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......

Node.js Error: Can’t set headers after they are sent to the client

Updated: Dec 27, 2023
An understanding of HTTP headers and response handling is crucial for Node.js developers, as it is foundational for web application development. In this guide, we’ll take a deep dive into the common error ‘Can’t set headers......
How to set up TypeScript for a Node.js project

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