Skip to content

doc: add missing return types in fs.md - #65307

Open
chasetonco wants to merge 1 commit into
nodejs:mainfrom
chasetonco:doc-fs-return-types
Open

doc: add missing return types in fs.md#65307
chasetonco wants to merge 1 commit into
nodejs:mainfrom
chasetonco:doc-fs-return-types

Conversation

@chasetonco

Copy link
Copy Markdown

Three entries in the fs documentation described their return value only in prose, or not at all, so the documentation tooling could not parse a return type and fell back to void:

  • filehandle[Symbol.asyncDispose]() and dir[Symbol.asyncDispose]() both return a promise. This matches the existing Returns: {Promise} annotations on other async dispose methods, such as heapProfileHandle[Symbol.asyncDispose]() in v8.md.
  • new fs.Utf8Stream([options]) is a constructor and returns an instance of the class, annotated the same way as the fs.ReadStream and fs.WriteStream constructors in this file.

No prose was changed; only the structured Returns: lines were added.

Verified by calling each function on a local build and by rendering fs.md locally, which now shows Promise, Promise and fs.Utf8Stream instead of void.

Refs: nodejs/doc-kit#953

Three entries in the fs documentation described their return value only in
prose, or not at all, so doc-kit could not parse a return type and fell back
to `void`:

* `filehandle[Symbol.asyncDispose]()` and `dir[Symbol.asyncDispose]()` both
  return a promise, matching the existing `Returns: {Promise}` annotations on
  other async dispose methods.
* `new fs.Utf8Stream([options])` is a constructor and returns an instance of
  the class.

Verified at runtime and by rendering the page locally with doc-kit.

Refs: nodejs/doc-kit#953
Signed-off-by: Chxxeton <43923165+Chxxeton@users.noreply.github.com>
@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. fs Issues and PRs related to the fs subsystem / file system. labels Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Issues and PRs related to the documentations. fs Issues and PRs related to the fs subsystem / file system.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants