Found 266 Articles for Node.js

How to Convert CSV to JSON file having Comma Separated values in Node.js?

Moksh Gupta
Updated on 18-Apr-2025 11:37:26

18 Views

Data conversion between different formats is a common requirement in modern web development and data processing pipelines. Among the most frequently needed conversions is transforming CSV (Comma Separated Values) files to JSON (JavaScript Object Notation), especially when working with Node.js applications.This complete tutorial describes various proven methods for CSV to JSON conversion in Node.js with instructions on processing header rows while handling internal field commas and optimizing performance for large file sizes. Why Convert CSV to JSON? The following section provides an understanding of the reasons behind converting CSV files to JSON documents. The majority ... Read More

How to read and write JSON file using Node?

Pankaj Kumar Bind
Updated on 03-Jan-2025 10:03:39

811 Views

Node.js provides powerful tools for working with files, including reading and writing JSON files. JSON (JavaScript Object Notation) is widely used for storing and exchanging data in applications. This article walks you through reading and writing JSON files in Node.js with examples. Approaches to Read JSON file Using fs.readFileSync (Synchronous) Using fs.readFile (Asynchronous) JSON File data.json { "name": "PankajBind", "age": 21, "skills": ["JavaScript", "Node.js", "React"] } Using fs.readFileSync (Synchronous) The fs module in Node.js provides methods to interact with the file ... Read More

How to Install Nodejs on Ubuntu?

Mead Naji
Updated on 19-Nov-2024 18:04:24

146 Views

Node.js is a well-known JavaScript runtime environment used to run JavaScript code on the server side. Using Node.js gives us the ability to execute code on the backend, extending JavaScript beyond just a traditional client side language. With this capability, you can build all kinds of applications that require a server to operate, such as an e-commerce application, a chat application, or even a social media app. Node.js is one of the most popular backend technologies used by developers worldwide to build server applications. In this tutorial, we will go through different ways to install and run Node.js on Ubuntu. ... Read More

How to Create and Run Node.js Project in VS Code Editor?

Moksh Gupta
Updated on 12-Nov-2024 10:30:01

528 Views

Node.js is one of the most vital tools in the hands of modern developers to create the necessary server applications. In this article, you will learn about how to create and run a Node.js project in one of the best, and most used, editors named Visual Studio Code (VS Code). What is Node.js? Node.js is an open-source cross-platform runtime environment for executing JavaScript code on the server side. It will be beneficial for creating web servers, APIs, and applications that run in real-time. Key Features of Node.js The following are the key features of Node.js − ... Read More

Difference between Node require and ES6 import and export

Moksh Gupta
Updated on 12-Nov-2024 10:59:46

58 Views

When working with JavaScript, especially in a Node.js or modern JavaScript environment, you often come across two popular module systems: use require which comes from the CommonJS and import and export keywords which came with ES6. They are both used with the same goal of modularizing your code but they differ as to how and what you use or do with them. Now let us discuss these differences in a greater detail. What is Node.js require? The require is the module-loading mechanism in CommonJS, the default module system for Node.js. It allows you to include modules, JSON files, or local ... Read More

How to use an ES6 import in Node.js?

Moksh Gupta
Updated on 12-Nov-2024 11:18:38

110 Views

Since ES6, JavaScript has a standardized way in terms of using the import statement in your project to include modules. Originally Node.js was using require() to import a module but with the update it is also imported ES6 import. This article will explain how to use ES6 import in Node.js, why it is important, and what constitutes good practice. Why Use ES6 Imports in Node.js? The following are some key reasons why you should use ES6 imports in Node.js − Modern Syntax: import is even better than require() to import modules because it is clean ... Read More

How to update Node.js and NPM to the latest version?

Moksh Gupta
Updated on 12-Nov-2024 11:36:23

116 Views

Having the latest Node.js and NPM is crucial as developers get to have access to the new features, security fixes, and improved performance. In those tools, you need to learn the following general steps in order to update them quickly This is the simplest guide to update those two tools. Why Update Node.js and NPM? Here are some reasons why you should update Node.js and NPM − Access New Features: Every one or two updates, new features and improvements make their ways into the software. Improved Security: Updates patch and other vulnerabilities in the environment so as to remove ... Read More

How to use Class in Node?

Moksh Gupta
Updated on 12-Nov-2024 12:02:03

142 Views

Introduction Node.js is trending as an environment where different efficient and logical applications are executed at the moment. One of them is extending modern JS syntax, for example,  classes, which makes OOP in Node.js more possible to use and improve. Scroll down to learn what a class is in Node.js, how one can be defined, how methods can/must be added, subclass/superclass in Node.js, and some uses of classes in Node.js. What is a Class in Node.js? A class is a blueprint of objects that have certain characteristics and behaviors or actions. Classes were introduced in ECMAScript 2015 ( ES6) as ... Read More

Difference between npm i and npm ci in Node.js

Moksh Gupta
Updated on 08-Nov-2024 10:52:26

82 Views

Dealing with Node.js, using npm (Node Package Manager), is important for creating and installing the necessary packages for the project. While most developers know what happens when running npm install or npm i, the npm ci often appears in discussions about continuous integration and continuous delivery pipelines alongside reproducible build processes. This article is about the distinction between "npm i" and "npm ci", the situations in which one should be used over the other, and how each is employed. What is npm i (or npm install)? The "npm i" is actually an abbreviation for npm install, which is the main ... Read More

How to read and write Excel file in Node.js?

Ernest Nnamdi
Updated on 05-Nov-2024 15:16:51

857 Views

ExcelJS is a JavaScript library that provides a convenient solution for working with '.xlsx' files, allowing you to read, manipulate, and save data programmatically using Node.js. In this tutorial, we'll walk through the steps for reading from and writing to Excel files in Node.js using ExcelJS. You'll learn how to initialize a workbook, read data from existing Excel files, dynamically build new worksheets, and save updates. Each section includes practical examples to help you apply the concepts in real-world scenarios. Prerequisite You should have a basic understanding of JavaScript You should ... Read More

1 2 3 4 5 ... 27 Next
Advertisements