Skip to main content

[JS] Node.js

File System (fs)

//asynchronou
fs.readFile() - Reads the content of a file asynchronously.
fs.writeFile() - Writes data to a file asynchronously.
fs.readdir() - Reads the contents of a directory asynchronously.
fs.mkdir() - Creates a directory asynchronously.
fs.stat() - Gets information about a file or directory asynchronously.
fs.rename() - Renames a file or directory asynchronously.
fs.unlink() - Deletes a file asynchronously.

//synchronous
fs.existsSync() - Checks if a file or directory exists synchronously.