Skip to content

fs: move DEP0180 to End-of-Life - #67491

Open
jasnell wants to merge 2 commits into
nodejs:mainfrom
jasnell:fs-eol-dep0180
Open

jasnell wants to merge 2 commits into
nodejs:mainfrom
jasnell:fs-eol-dep0180

Conversation

@jasnell

@jasnell jasnell commented Nov 15, 2026

Copy link
Copy Markdown
Member

Calling the fs.Stats constructor directly, with or without new, now throws ERR_ILLEGAL_CONSTRUCTOR. fs.Stats instances are only created internally.

The class remains exported from node:fs so that instanceof checks continue to work. Internally, instances are constructed through a private symbol.

This has been a runtime deprecation since v22.0.0.

Refs: #52067
Refs: #51879

Calling the fs.Stats constructor directly, with or without new, now
throws ERR_ILLEGAL_CONSTRUCTOR. fs.Stats instances are only created
internally.

The class remains exported from node:fs so that instanceof checks
continue to work. Internally, instances are constructed through a
private symbol.

This has been a runtime deprecation since v22.0.0.

Refs: nodejs#52067
Refs: nodejs#51879
Assisted-by: Claude
Signed-off-by: James M Snell <jasnell@gmail.com>
@jasnell
jasnell requested a review from a team November 15, 2026 16:46
@jasnell jasnell added semver-major PRs that contain breaking changes and should be released in the next major version. deprecations Issues and PRs related to deprecations. labels Nov 15, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/userland-migrations

@nodejs-github-bot nodejs-github-bot added fs Issues and PRs related to file-system APIs and the fs module. needs-ci PRs that need a full CI run. labels Nov 15, 2026
Comment thread doc/api/deprecations.md Resolved
Comment thread doc/api/fs.md Resolved
Co-authored-by: James M Snell <jasnell@gmail.com>
@jasnell jasnell added the commit-queue-squash PRs the Commit Queue should land as one squashed commit. label Nov 15, 2026
@codecov

codecov Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.65%. Comparing base (d105ef7) to head (43ad4b9).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67491      +/-   ##
==========================================
- Coverage   90.67%   90.65%   -0.02%     
==========================================
  Files         799      799              
  Lines      280245   280249       +4     
  Branches    54125    54114      -11     
==========================================
- Hits       254100   254068      -32     
- Misses      16280    16291      +11     
- Partials     9865     9890      +25     
Files with missing lines Coverage Δ
lib/internal/fs/utils.js 96.10% <100.00%> (+0.01%) ⬆️

... and 34 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jasnell jasnell added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 15, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 15, 2026
@nodejs-github-bot

nodejs-github-bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

@jasnell

jasnell commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

@nodejs/tsc ... will need another sign off here

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@jasnell jasnell added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Nov 15, 2026

@LiviaMedeiros LiviaMedeiros left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this shouldn't land until we have better alternative (e.g. fs.isStats()) to instanceof Stats that we can recommend in the docs, or make such instanceof work with BigIntStats as well.

Comment thread doc/api/deprecations.md
Comment on lines +4069 to +4070
for public use. The class remains exported, so `instanceof fs.Stats` checks
continue to work.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This recommendation doesn't look correct, because

fs.statSync('/etc/hosts') instanceof fs.Stats === true
// however:
fs.statSync('/etc/hosts', { bigint: true }) instanceof fs.Stats === false
// and:
fs.BigIntStats === undefined

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

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue-squash PRs the Commit Queue should land as one squashed commit. deprecations Issues and PRs related to deprecations. fs Issues and PRs related to file-system APIs and the fs module. needs-ci PRs that need a full CI run. semver-major PRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants