The fs/promises API provides asynchronous file system methods that return promises
Answer: To use promise-based file APIs, import node:fs/promises. The fs/promises API provides asynchronous file system methods that return promises. Close it with filehandle.close(); if you do not, the handle stays open.
Import paths
The docs show import * as fs from 'node:fs/promises' for ESM and require('node:fs/promises') for CommonJS. The callback and sync APIs stay on node:fs.
FileHandle
A FileHandle is an EventEmitter wrapper around a descriptor. The 'close' event fires when the handle has been closed.
Claims
- id: C1 claim: The promise API lives on node:fs/promises. source: S1 evidence: "import * as fs from 'node:fs/promises'"
- id: C2 claim: fs/promises methods are asynchronous and return promises. source: S1 evidence: "The
fs/promisesAPI provides asynchronous file system methods that return promises"
- id: C3 claim: The published API page documents the same module path. source: S2 evidence: "node:fs/promises"
- id: C4 claim: The published API page also describes the promise-returning methods. source: S2 evidence: "asynchronous file system methods that return promises"
Sources
- [S1] Node.js File system promises API. nodejs/node (GitHub). https://github.com/nodejs/node/blob/main/doc/api/fs.md . License: MIT. Accessed 2026-11-18.
- [S2] Node.js File system (website). Node.js docs. https://nodejs.org/docs/latest/api/fs.html . License: MIT. Accessed 2026-11-18.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: nodejs/node (GitHub), Node.js File system promises API, MIT (https://raw.githubusercontent.com/nodejs/node/main/LICENSE); Node.js docs, Node.js File system (website), MIT (https://raw.githubusercontent.com/nodejs/node/main/LICENSE). Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: nodejs/node (GitHub), Node.js File system promises API, MIT (https://raw.githubusercontent.com/nodejs/node/main/LICENSE); Node.js docs, Node.js File system (website), MIT (https://raw.githubusercontent.com/nodejs/node/main/LICENSE).
Cite this
iinventedlight. 2026. "The fs/promises API provides asynchronous file system methods that return promises." iinventedlight Library, iil:note:62pm7t80, version of 2026-11-18. https://iinventedlight.com/library/notes/node-fs-promises/. License: CC-BY-4.0.
@misc{iil_note_62pm7t80,
author = {{iinventedlight}},
title = {{The fs/promises API provides asynchronous file system methods that return promises}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-18},
url = {https://iinventedlight.com/library/notes/node-fs-promises/},
note = {Permanent ID iil:note:62pm7t80. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/node-fs-promises.md.