Tag: fs

How to create symlinks in Node.js? Symbolic link with Node.js

Introduction A symbolic link (also symlink or soft link) is a term for any file that contains a reference to another file or directory in the form of an absolute or relative path. Node.js built-in fs module provides APIs to create symlink. fs.symlink() method is used to create a symlink to the given path asynchronously. fs.symlinkSync() method is used to

Read more

Writing to File in Node.js

Introduction Writing some content to a file is a very common programming task. If you are building an application, then one of the important things is to write the content to a file. Node.js core API provides methods to make it easier for us. Node.js fs module provides API to do file operations. One simplest

Read more

How to delete folder in Node.js? fs.rmdir() – Node.js

Introduction In this blog post, we will learn how to delete a folder programmatically in Node.js. Although there are a lot of other ways to delete folders in Node.js one common way is to use a system command. Node.js provides child_process module to execute shell commands. It is not advisable to use child_process module which

Read more

How to Open File in Node.js?

Introduction Opening a file is a common programming technique. Every web application does a file open operation. Whenever a file read or file write operation executes eventually it does a file open call as well. Without file open operation, reading and writing to a file are not possible. To open file in Node.js, We can

Read more

How to delete a file in Node.js? Remove file with Node

Introduction In this blog post, we will learn how to delete a file or symbolic link in Node.js. Node.js core fs module provides APIs to remove files or symlinks from the file system. fs.unlink() is used to asynchronously remove a file or symbolic link. fs.unlinkSync() is used to synchronously remove a file or symbolic link.

Read more

How to rename file in Node.js? fs.rename() Node.js

Introduction In this blog post, we will learn how to rename a file in Node.js using fs module. fs mdoule provides various synchronous and asynchronous APIs to rename files. Let’s get start. fs.rename() The fs.rename() is used to asynchronously rename a file at the given old path to provided new path. In the case that a new

Read more

How to append to a file in Node.js?

Introduction: In this blog post, We will learn how to append contents to the end of the file instead of overwriting the file’s content. Sometimes it is necessary to keep the previous content of a file for debugging purposes. For example, if you are logging into a file then in this case you don’t want

Read more

File System Module in Node.js

The File System (FS) module of Node.js is a powerful tool for developers who need to manage files and directories in their applications. This module provides a way to create, read, write, and delete files and directories with a few lines of code. Furthermore, this module also provides ways to manipulate the data associated with

Read more

Please disable your adblocker or whitelist this site!

How to whitelist website on AdBlocker?

How to whitelist website on AdBlocker?

  1. 1 Click on the AdBlock Plus icon on the top right corner of your browser
  2. 2 Click on "Enabled on this site" from the AdBlock Plus option
  3. 3 Refresh the page and start browsing the site