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()
↔fs
Static Method to Sync read dir contentreadFileSync()
↔fs
Static Method to Sync read file contentreadFile()
↔fs
Static Method toasync
read contents of filereaddir()
↔fs
Static Method toasync
read dir contentwriteFile()
↔fs
Static Method toasync
write data to filewriteFileSync()
↔fs
Static Method to Sync write data to fileappendFile()
↔fs
Static Method toasync
append data to fileappendFileSync()
↔fs
Static Method to Sync append data to fileexistsSync()
↔fs
Static Method to check Sync if path existsmkdirSync()
↔fs
Static Method to Sync make new dirmkdir()
↔fs
Static Method toasync
make new dirunlinkSync()
↔fs
Static Method to Sync remove file/Symbolic Linkrename()
↔fs
Static Method toasync
rename file (to new path)renameSync()
↔fs
Static Method to Sync rename fileunlink()
↔fs
Static Method toasync
remove file/Symbolic LinkrmdirSync()
↔fs
Static Method to Sync remove dirrmdir()
↔fs
Static Method toasync
remove dircreateReadStream()
↔fs
Static Method to create aReadable
filestream
createWriteStream()
↔fs
Static Method to create aWritable
filestream
Back-end App (JS)
↔ App to execute Node.js Runtime with access tofs
, DB and network serversfs-extra
↔ Node Lib extendsfs
withPromise
-based functions that cut down on Boilerplate