Sling Academy
Home/Node.js/Page 45

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.

How to Write C/C++ Addons for Node.js

Updated: Dec 28, 2023
Overview Node.js is a powerful platform for building network applications. It is written in C, C++, and JavaScript, providing a versatile environment for developers. While JavaScript is the core language for writing Node.js modules,......

Node.js & Express: How to Upload Files Using Multer

Updated: Dec 28, 2023
Overview Multer is a Node.js middleware for handling multipart/form-data, which is primarily used for uploading files. It is written on top of busboy (busboy – not badboy – a streaming parser for HTML form data for Node.js)......

How to Read and Write Text Files (.txt) in Node.js

Updated: Dec 28, 2023
Overview Node.js is a powerful JavaScript runtime built on Chrome’s V8 engine. It provides a rich set of filesystem operations through its ‘fs’ module, which can be used to perform tasks such as reading from and......

How to Setup a Node.js Cluster for Speed & Stability

Updated: Dec 28, 2023
Learn how to setup a Node.js cluster to improve the speed and stability of your project. Overview Node.js is a powerful JavaScript runtime built on Chrome’s V8 engine. It is designed to build scalable network applications.......

Node.js: How to use Handlebars to render HTML templates

Updated: Dec 28, 2023
Handlebars is a popular templating engine that is used to create dynamic HTML templates. It extends the Mustache templating language by adding powerful features like helpers and more advanced block expressions. Handling templates with......

How to Read and Write CSV Files with Node.js

Updated: Dec 28, 2023
Overview Working with CSV files is a common task in software development, and Node.js makes it simple to read from and write to these files with both built-in modules and community-driven packages. CSV, or Comma-Separated Values, is a......

How to Integrate H2 Database with Express and Node.js

Updated: Dec 28, 2023
In this tutorial, we’ll learn how to integrate the H2 database with an Express application running on Node.js. H2 is a Java-based SQL database which is often used for development and testing purposes due to its in-memory nature.......

How to Serve Static Files with Express and Node.js

Updated: Dec 28, 2023
Overview When building web applications with Express and Node.js, one often needs to serve static files such as images, CSS files, and JavaScript files. Express, a web application framework for Node.js, includes a middleware function......

Using Environment Variables in Node.js (3 Approaches)

Updated: Dec 28, 2023
Explore 3 different approaches to managing environment variables (env) in Node.js projects. Solution 1: dotenv Package The dotenv package is a zero-dependency module that loads environment variables from a .env file into......

3 Ways to Convert Callbacks to Promises in Node.js

Updated: Dec 28, 2023
Some different ways to convert callbacks to promises in Node.js applications. Utilizing Promisify Utility The util.promisify function is a built-in utility in Node.js that converts a callback-based function to a Promise-based one.......

How to Send Email in Node.js (3 Approaches)

Updated: Dec 28, 2023
Solution 1: Using Nodemailer Nodemailer is a popular Node.js module for sending emails. It supports multiple transport methods, including SMTP and direct sending. Install the ‘nodemailer’ package using npm: npm install......

How to Add Watermark to Images in Node.js (3 Ways)

Updated: Dec 28, 2023
Adding watermarks to images can be essential for copyright protection, preventing unauthorized use or distribution of your images. It helps in branding, ensuring your logo or name is visibly associated with your content. This concise,......