node:fs

#Import

import fs from "nstdlib/fs";

Note

Its behavior matches Node.js. Details: over a node:vfs memory mount. Paths outside a mount still throw.

#Runtime support

Where it runsStatusExport coverageDetails
nstd✅ worksNative tests match Node.js: fs, fs-watch.
Browser❔ not tested100% of Node.jsIt imports with the small process shim. 102/102 Node.js exports are available. No module-specific behavior test ran.
Node.js (host)✅ works100% of Node.js104/104 exports.

#Exports (104 of 104)

Each cell shows what happens when code reads an export:

  • ✅ Available through every import style. A named error also counts.
  • ⚠️ Available through only some import styles.
  • ❔ The export exists but has no value.
  • ❌ The export does not exist.
  • – This environment was not measured.
Show all 104 exports
ExportNode.jsnstdlibbrowser
Dir
Dirent
FileReadStream
FileWriteStream
ReadStream
Stats
Utf8Stream
WriteStream
_toUnixTimestamp
access
accessSync
appendFile
appendFileSync
chmod
chmodSync
chown
chownSync
close
closeSync
constants
copyFile
copyFileSync
cp
cpSync
createReadStream
createWriteStream
exists
existsSync
fchmod
fchmodSync
fchown
fchownSync
fdatasync
fdatasyncSync
fstat
fstatSync
fsync
fsyncSync
ftruncate
ftruncateSync
futimes
futimesSync
glob
globSync
lchmod
lchmodSync
lchown
lchownSync
link
linkSync
lstat
lstatSync
lutimes
lutimesSync
mkdir
mkdirSync
mkdtemp
mkdtempDisposableSync
mkdtempSync
open
openAsBlob
openSync
opendir
opendirSync
promises
read
readFile
readFileSync
readSync
readdir
readdirSync
readlink
readlinkSync
readv
readvSync
realpath
realpathSync
rename
renameSync
rm
rmSync
rmdir
rmdirSync
stat
statSync
statfs
statfsSync
symlink
symlinkSync
truncate
truncateSync
unlink
unlinkSync
unwatchFile
utimes
utimesSync
watch
watchFile
write
writeFile
writeFileSync
writeSync
writev
writevSync