Skip to content

Conversation

@luffy84217
Copy link

There's non toggle button at every piece of code in file system doc. This would be of no use if the developer has not imported the fs module in every piece of code just like in any other docs.

Fixes: #59769
Refs: https://nodejs.org/docs/latest/api/fs.html

@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 Sep 10, 2025
@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. and removed author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. labels Nov 8, 2025
There's non toggle button at every piece of code in file system doc.
This would be of no use if the developer has not imported the fs module
in every piece of code just like in any other docs.

Fixes: nodejs#59769
Refs: https://nodejs.org/docs/latest/api/fs.html
@aduh95 aduh95 force-pushed the doc/add-missing-api-fs-cjs-code-snippet branch from 66768f0 to 96ac742 Compare November 28, 2025 19:39
});
// This method is *CORRECT*:
import { sep } from 'node:path';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { sep } from 'node:path';
const { sep } = require('node:path');

const { readFile } = require('node:fs');

readFile('/etc/passwd', 'utf8', callback);
``
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
``
```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. 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.

Frontend Error : There's non toggle button at every piece of code in file system doc.

4 participants