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 runs | Status | Export coverage | Details |
|---|---|---|---|
| nstd | ✅ works | – | Native tests match Node.js: fs, fs-watch. |
| Browser | ❔ not tested | 100% of Node.js | It imports with the small process shim. 102/102 Node.js exports are available. No module-specific behavior test ran. |
| Node.js (host) | ✅ works | 100% of Node.js | 104/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
| Export | Node.js | nstdlib | browser |
|---|---|---|---|
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 | ✅ | ✅ | ✅ |