September 2024
Beginner to intermediate
985 pages
35h 37m
English
Node.js offers a myriad of functions for working with the file system. You can read files, write files, create directories, rename files and directories, change permissions on both, and much, much more. We’ll only look at an excerpt of these functions here.
The internal and default package available with every Node.js installation that provides the helper functions is the fs package (fs is for file system; see https://nodejs.org/api/fs.html).
For example, to read files, you have the option to do this asynchronously or synchronously (as is the case with many of the other file operations). Asynchronous reading is done with the readFile() function, which, as shown in Listing 17.9, expects ...
Read now
Unlock full access