fs API promise
fs API promise file
const fs = fs
Even a synchronous API, it does not need to use try-catch
// return the data or instanceof Error const data = fs console console // or // return the data or null const data = fs console // or fs
API List
- for native
- constants
- Stats
- F_OK
- R_OK
- W_OK
- X_OK
- access
- accessSync
- exists
- existsSync
- readFile
- readFileSync
- close
- closeSync
- open
- openSync
- read
- readSync
- write
- writeSync
- rename
- renameSync
- truncate
- truncateSync
- ftruncate
- ftruncateSync
- rmdir
- rmdirSync
- fdatasync
- fdatasyncSync
- fsync
- fsyncSync
- mkdir
- mkdirSync
- readdir
- readdirSync
- fstat
- lstat
- stat
- fstatSync
- lstatSync
- statSync
- readlink
- readlinkSync
- symlink
- symlinkSync
- link
- linkSync
- unlink
- unlinkSync
- fchmod
- fchmodSync
- chmod
- chmodSync
- fchown
- fchownSync
- chown
- chownSync
- _toUnixTimestamp
- utimes
- utimesSync
- futimes
- futimesSync
- writeFile
- writeFileSync
- appendFile
- appendFileSync
- watch
- watchFile
- unwatchFile
- realpathSync
- realpath
- mkdtemp
- mkdtempSync
- copyFile
- copyFileSync
- createReadStream
- ReadStream
- FileReadStream
- createWriteStream
- WriteStream
- FileWriteStream
- extensions
- exsits
- exsitsSync
- mkdirSync