fs ↔ Node API to interact with OS File System - always use fs-extra for async ops!
var fs = require("fs")
var fs = require("fs/promises")
readdir()
fs Static Method to async read dir content
readdirSync()
fs Static Method to Sync read dir content
readFile()
fs Static Method to async read contents of file
readFileSync()
fs Static Method to Sync read file content
writeFile()
fs Static Method to async write data to file
writeFileSync()
fs Static Method to Sync write data to file
appendFile()
fs Static Method to async append data to file
appendFileSync()
fs Static Method to Sync append data to file
mkdirSync()
fs Static Method to Sync make new dir
mkdir()
fs Static Method to async make new dir
existsSync()
fs Static Method to check Sync if path exists
rename()
fs Static Method to async rename file (to new path)
renameSync()
fs Static Method to Sync rename file
unlink()
fs Static Method to async remove file/Symbolic Link
unlinkSync()
fs Static Method to Sync remove file/Symbolic Link
rmdir()
fs Static Method to async remove dir
rmdirSync()
fs Static Method to Sync remove dir
createReadStream()
fs Static Method to create a Readable file stream
createWriteStream()
fs Static Method to create a Writable file stream
fs-extra
Node Lib extends fs with Promise-based functions that cut down on Boilerplate
References
readdirSync()↔fsStatic Method to Sync read dir contentreadFileSync()↔fsStatic Method to Sync read file contentreadFile()↔fsStatic Method toasyncread contents of filereaddir()↔fsStatic Method toasyncread dir contentwriteFile()↔fsStatic Method toasyncwrite data to filewriteFileSync()↔fsStatic Method to Sync write data to fileappendFile()↔fsStatic Method toasyncappend data to fileappendFileSync()↔fsStatic Method to Sync append data to fileexistsSync()↔fsStatic Method to check Sync if path existsmkdirSync()↔fsStatic Method to Sync make new dirmkdir()↔fsStatic Method toasyncmake new dirunlinkSync()↔fsStatic Method to Sync remove file/Symbolic Linkrename()↔fsStatic Method toasyncrename file (to new path)renameSync()↔fsStatic Method to Sync rename fileunlink()↔fsStatic Method toasyncremove file/Symbolic LinkrmdirSync()↔fsStatic Method to Sync remove dirrmdir()↔fsStatic Method toasyncremove dircreateReadStream()↔fsStatic Method to create aReadablefilestreamcreateWriteStream()↔fsStatic Method to create aWritablefilestreamBack-end App (JS)↔ App to execute Node.js Runtime with access tofs, DB and network serversfs-extra↔ Node Lib extendsfswithPromise-based functions that cut down on Boilerplate