How to use the File System in Node.js - SitePoint
Briefly

Web applications don't always need to write to the file system, but Node.js provides a comprehensive application programming interface (API) for doing so. It may be essential if you're outputting debugging logs, transferring files to or from a server, or creating command line tools. Reading and writing files from code is not necessarily difficult, but your application will be more robust if you do the following:
The fs documentation provides a long list of functions, but there are three general types with similar functions, which we'll look at next.
Users or other apps could delete a file or change access permissions. Always check for such issues and handle errors effectively.
Read at Sitepoint
[
add
]
[
|
|
]