node:fs/promises
#Import
import fs_promises from "nstdlib/node/fs/promises";Note
Behaves like Node.js. Over a node:vfs memory mount. Paths outside a mount still throw.
#Support
- nstd: Gives the same output as Node.js in side-by-side tests: fs.
- Browser: Loads with a minimal
processobject. 33 of Node's 33 exports are available. 1 of 1 behavior checks match Node.js.
#Exports (33)
Every name Node.js exports from this module, and what you get when you read it, as a named import or as a property of the default import:
- ✅ A value, both ways. An export that throws an error naming the missing feature also counts.
- ⚠️ A value one way,
undefinedthe other. - ❔
undefinedboth ways. - ❌ Not exported at all.
- – Not measured.
| Export | Node.js | Browser |
|---|---|---|
access | ✅ | ✅ |
appendFile | ✅ | ✅ |
chmod | ✅ | ✅ |
chown | ✅ | ✅ |
constants | ✅ | ✅ |
copyFile | ✅ | ✅ |
cp | ✅ | ✅ |
glob | ✅ | ✅ |
lchmod | ✅ | ✅ |
lchown | ✅ | ✅ |
link | ✅ | ✅ |
lstat | ✅ | ✅ |
lutimes | ✅ | ✅ |
mkdir | ✅ | ✅ |
mkdtemp | ✅ | ✅ |
mkdtempDisposable | ✅ | ✅ |
open | ✅ | ✅ |
opendir | ✅ | ✅ |
readFile | ✅ | ✅ |
readdir | ✅ | ✅ |
readlink | ✅ | ✅ |
realpath | ✅ | ✅ |
rename | ✅ | ✅ |
rm | ✅ | ✅ |
rmdir | ✅ | ✅ |
stat | ✅ | ✅ |
statfs | ✅ | ✅ |
symlink | ✅ | ✅ |
truncate | ✅ | ✅ |
unlink | ✅ | ✅ |
utimes | ✅ | ✅ |
watch | ✅ | ✅ |
writeFile | ✅ | ✅ |
#Diagnostics
nstdlib running inside Node.js. This isn't an environment it's meant for, so it isn't shown above, but it tells a library problem from an environment one:
coverage: 33/33 of the host's export names answer inside host node. Behaviour verified against the host builtin. Over anode:vfsmemory mount. Paths outside a mount still throw.smoke: Imports in a clean child process.node-suite: 270/367 of Node's own eligible tests pass with ./dist inside host node. A failure there and in the page is the library's, one only in the page is the engine's (filed underfs, the parent module).