Skip to main content

Module fs_promises

Module fs_promises 

Source
Expand description

Node fs/promises (also require('fs').promises) — Promise-returning file operations.

Every method delegates to the SAME synchronous I/O the *Sync fs module performs (readFile→readFileSync, chmod→chmodSync, …), then wraps the outcome in a settled Promise: fulfilled with the value on success, rejected with an Error object on failure. Delegating to fs::call keeps the encoding handling, Stats/Dirent/Dir shapes, and error strings identical to the rest of fs.

The work is performed synchronously (node-js has no thread-pooled fs at this layer); the Promise is already settled when returned, so await/.then observe the result on the next microtask tick — the observable contract callers rely on.

Constants§

METHODS

Functions§

call