Visitar URL original
fix(node/v24): update fs and fs/promises to Node v24.20 by trim21 · Pull Request #75474 · DefinitelyTyped/DefinitelyTyped · GitHub
Skip to content

fix(node/v24): update fs and fs/promises to Node v24.20 - #75474

Closed
trim21 wants to merge 3 commits into
DefinitelyTyped:masterfrom
trim21:node-v24-fs-watch-ignore
Closed

trim21 wants to merge 3 commits into
DefinitelyTyped:masterfrom
trim21:node-v24-fs-watch-ignore

Conversation

@trim21

@trim21 trim21 commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Package in scope

@types/node — the v24 snapshot only (types/node/v24). types/node (v26) and types/node/v25 already ship all of these APIs.

What changes

Brings types/node/v24's fs and fs/promises modules up to date with the Node.js v24.20 API surface:

  • fs.watch(): ignore option (v24.14, nodejs/node#61433) — new WatchIgnorePredicate type plus WatchOptions.ignore; fsPromises.watch() inherits it via _WatchOptions.
  • fs.stat() / fs.promises.stat(): throwIfNoEntry option (v24.15, nodejs/node#61178). StatOptions gains the field (previously only on StatSyncOptions), and the async overloads now return Stats | undefined / BigIntStats | undefined when it is set to false.
  • fs.statfs() family: frsize on StatsFs / BigIntStatsFs (v24.16, nodejs/node#62277).
  • fs.glob() / fs.globSync() / fsPromises.glob(): followSymlinks option (v24.16, nodejs/node#62695).
  • fs.readFile() / fs.readFileSync() / fsPromises.readFile() / filehandle.readFile(): buffer option accepting a pre-allocated view or a (size) => buffer factory (v24.19, nodejs/node#63634). Returns BufferView<T>, which required adding the BufferView type to buffer.buffer.d.ts (including the TS 5.6 fallback).

stat's signal option is intentionally not typed: in v24.20 the implementation only exists on callback fs.stat() while the docs also mention it on filehandle.stat(). types/node carries a TODO on StatOptions to revisit this once upstream sorts the behavior out, and this PR mirrors that decision.

Why v24 is missing these

types/node/v24 was cut while types/node tracked Node 24.13 (types/node/v24/package.json is still 24.13.9999). Every API above landed on the v24 line after that cut, and the vNN/ snapshots don't pick up new APIs automatically.

Tests

types/node/v24/test/fs.ts covers:

  • all four accepted ignore shapes (glob string, RegExp, predicate, array) for fs.watch(), plus two fsPromises.watch() cases;
  • throwIfNoEntry for fs.stat() and fs.promises.stat() (return-type widening for the false case), with existing statSync/lstatSync expectations kept;
  • frsize on both StatsFs variants;
  • followSymlinks for fs.glob() / fs.globSync() / fsPromises.glob();
  • the buffer option for all four readFile variants (pre-allocated Uint8Array, SharedArrayBuffer-backed, Buffer, and factory function).

Notes for reviewers

  • types/node/v24/package.json version is intentionally left at 24.13.9999: bumping that marker is what the periodic node: v24.x PRs do, together with the full multi-module sync.
  • All changes are ports of the declarations already in types/node (v26), adjusted to the v24.20 API surface.
  • Verified locally with pnpm run lint types/node/v24 (dtslint, TS 5.6 – 6.0) and dprint fmt; leaving the authoritative run to CI.

Context for the suggested changes:


Please fill in this template.

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: https://nodejs.org/docs/latest-v24.x/api/fs.html
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the package.json. (intentionally not bumped; see notes above)

@typescript-automation

typescript-automation Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

@trim21 Thank you for submitting this PR!

This is a live comment that I will keep updated.

1 package in this PR

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • 🕐 Most recent commit is approved by a DT maintainer

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.

Inactive

This PR has been inactive for 13 days — please try to get reviewers!


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 75474,
  "author": "trim21",
  "headCommitOid": "df7eb79a6caaca8c05b8a301b24ca87727f42eb6",
  "mergeBaseOid": "127fd9871abcf3ff2a66bdc92fc85c77e725a466",
  "lastPushDate": "2026-09-01T03:41:14.000Z",
  "lastActivityDate": "2026-09-14T17:26:00.000Z",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "tooManyCommits": false,
  "tooManyReviews": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "node",
      "version": "26.4",
      "kind": "edit",
      "files": [
        {
          "path": "types/node/v24/buffer.buffer.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/v24/fs.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/v24/fs/promises.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/v24/test/fs.ts",
          "kind": "test"
        },
        {
          "path": "types/node/v24/ts5.6/buffer.buffer.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "Microsoft",
        "jkomyno",
        "r3nya",
        "btoueg",
        "touffy",
        "mohsen1",
        "galkin",
        "eps1lon",
        "WilcoBakker",
        "chyzwar",
        "trivikr",
        "yoursunny",
        "qwelias",
        "ExE-Boss",
        "peterblazejewicz",
        "addaleax",
        "victorperin",
        "NodeJS",
        "LinusU",
        "wafuwafu13",
        "mcollina",
        "Semigradsky",
        "Renegade334",
        "anonrig"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [],
  "mainBotCommentID": 5488562766,
  "ciResult": "pass"
}

@typescript-automation

Copy link
Copy Markdown
Contributor

🔔 @microsoft @jkomyno @r3nya @btoueg @Touffy @mohsen1 @galkin @eps1lon @WilcoBakker @chyzwar @trivikr @yoursunny @qwelias @ExE-Boss @peterblazejewicz @addaleax @victorperin @nodejs @LinusU @wafuwafu13 @mcollina @Semigradsky @Renegade334 @anonrig — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-automation typescript-automation Bot moved this from Waiting for Code Reviews to Needs Maintainer Review in Pull Request Status Board Sep 1, 2026
@trim21 trim21 changed the title feat(node/fs): add ignore option to watch() in v24 fix(node/v24): add missing ignore option to fs.watch() Sep 1, 2026
@typescript-automation typescript-automation Bot moved this from Needs Maintainer Review to Waiting for Code Reviews in Pull Request Status Board Sep 1, 2026
@trim21 trim21 changed the title fix(node/v24): add missing ignore option to fs.watch() fix(node/v24): update fs and fs/promises to Node v24.20 Sep 1, 2026
@typescript-automation typescript-automation Bot moved this from Waiting for Code Reviews to Needs Maintainer Review in Pull Request Status Board Sep 1, 2026
@typescript-automation typescript-automation Bot added the Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. label Sep 12, 2026
@typescript-automation

Copy link
Copy Markdown
Contributor

Re-ping @microsoft, @jkomyno, @r3nya, @btoueg, @Touffy, @mohsen1, @galkin, @eps1lon, @WilcoBakker, @chyzwar, @trivikr, @yoursunny, @qwelias, @ExE-Boss, @peterblazejewicz, @addaleax, @victorperin, @nodejs, @LinusU, @wafuwafu13, @mcollina, @Semigradsky, @Renegade334, @anonrig:

This PR has been out for over a week, yet I haven't seen any reviews.

Could someone please give it some attention? Thanks!

@Renegade334

Copy link
Copy Markdown
Contributor

Thanks for pointing out the outdated types.

Awkwardly, when it comes to DT, we have to produce package updates as a whole, since merging individual features in isolation will pollute older @types/node versions whose corresponding Node.js version didn't have those features. Ordinarily we just cherry-pick these from the active branch, but once that started falling behind, the active LTS branch also started lagging as a result.

#75574 is a full version rollup, which includes the features referenced here.

@trim21

trim21 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

thanks

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

Labels

Critical package Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants