...

/

The fs Module

The fs Module

Learn about the fs module

Overview

The fs module is a built-in global Node.js module that exposes an API for accessing, manipulating, and interacting with the file system.

We’ll use a few methods from the fs module to read and write information to test.txt.

All fs operations are available either in synchronous or asynchronous forms (click here for details).

In this chapter, we’ll use a newer feature of fs, called the fs Promises API, which returns Promise objects so that we can use the async and await keywords instead of callbacks to handle ...