What Is the Node.js fs (File System) Module?

Опубликовано: 28 Январь 2021
на канале: Hey Node
652
9

See the written version of this tutorial for links to prerequisites and related tutorials: https://heynode.com/tutorial/what-fs-...

The built-in Node.js file system module helps us store, access, and manage data on our operating system. Commonly used features of the fs module include fs.readFile to read data from a file, fs.writeFile to write data to a file and replace the file if it already exists, fs.watchFile to get notified of changes, and fs.appendFile to append data to a file. The fs core module is available in every Node.js project without having to install it.

By the end of this tutorial, you should be able to:

Understand common uses for the Node file system module
Learn about relative file paths when using the fs module
Asynchronous vs synchronous fs methods in Node
Have a good overview of the new promise-based version of the fs module
Understand when we can’t rely on the Node fs module

Heynode.com: The best online Node.js courses and tutorials to help you solve hard problems fast.