Skip to content

feat(node/fs/promises): update data type for appendFile() & writeFile() - #75205

Merged
typescript-automation[bot] merged 4 commits into
DefinitelyTyped:masterfrom
hkleungai:node-fs-promises-update-appendFile-writeFile-data-type
Jul 8, 2026
Merged

typescript-automation[bot] merged 4 commits into
DefinitelyTyped:masterfrom
hkleungai:node-fs-promises-update-appendFile-writeFile-data-type

Conversation

@hkleungai

Copy link
Copy Markdown
Contributor

Resolves #75147.

Also opening nodejs/node#64279 in parallel.


Please fill in this template.

Select one of these and delete the others:

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: <>

@typescript-automation

typescript-automation Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

@hkleungai 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

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 75205,
  "author": "hkleungai",
  "headCommitOid": "95681d30b42c772bc33048e30ed1da0291212da3",
  "mergeBaseOid": "99572e353d5e1590be742ef931cfc61f9b5ed15c",
  "lastPushDate": "2026-07-04T08:12:39.000Z",
  "lastActivityDate": "2026-07-08T06:36:45.000Z",
  "mergeOfferDate": "2026-07-07T22:53:37.000Z",
  "mergeRequestDate": "2026-07-08T06:36:45.000Z",
  "mergeRequestUser": "hkleungai",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "tooManyCommits": false,
  "tooManyReviews": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "node",
      "kind": "edit",
      "files": [
        {
          "path": "types/node/fs/promises.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/node-tests/fs.ts",
          "kind": "test"
        },
        {
          "path": "types/node/v22/fs/promises.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/v22/test/fs.ts",
          "kind": "test"
        },
        {
          "path": "types/node/v24/fs/promises.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/v24/test/fs.ts",
          "kind": "test"
        },
        {
          "path": "types/node/v25/fs/promises.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/v25/node-tests/fs.ts",
          "kind": "test"
        }
      ],
      "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": [
    {
      "type": "approved",
      "reviewer": "iisaduan",
      "date": "2026-07-07T22:53:00.000Z",
      "isMaintainer": true
    },
    {
      "type": "approved",
      "reviewer": "Renegade334",
      "date": "2026-07-07T15:07:48.000Z",
      "isMaintainer": false
    }
  ],
  "mainBotCommentID": 4881254279,
  "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 Jul 4, 2026
@typescript-automation typescript-automation Bot added the Has Merge Conflict This PR can't be merged because it has a merge conflict. The author needs to update it. label Jul 6, 2026
@typescript-automation typescript-automation Bot moved this from Needs Maintainer Review to Needs Author Action in Pull Request Status Board Jul 6, 2026
@typescript-automation

Copy link
Copy Markdown
Contributor

@hkleungai Unfortunately, this pull request currently has a merge conflict 😥. Please update your PR branch to be up-to-date with respect to master. Have a nice day!

Comment thread types/node/fs/promises.d.ts Outdated
@typescript-automation typescript-automation Bot removed the Has Merge Conflict This PR can't be merged because it has a merge conflict. The author needs to update it. label Jul 7, 2026
@typescript-automation typescript-automation Bot moved this from Needs Author Action to Waiting for Code Reviews in Pull Request Status Board Jul 7, 2026
@typescript-automation typescript-automation Bot moved this from Waiting for Code Reviews to Needs Maintainer Review in Pull Request Status Board Jul 7, 2026
@typescript-automation

Copy link
Copy Markdown
Contributor

@Renegade334 Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review?

@typescript-automation typescript-automation Bot moved this from Needs Maintainer Review to Waiting for Code Reviews in Pull Request Status Board Jul 7, 2026

@Renegade334 Renegade334 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Awesome, thanks so much!

@typescript-automation typescript-automation Bot added the Owner Approved A listed owner of this package signed off on the pull request. label Jul 7, 2026
@typescript-automation typescript-automation Bot moved this from Waiting for Code Reviews to Needs Maintainer Review in Pull Request Status Board Jul 7, 2026
@typescript-automation typescript-automation Bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner labels Jul 7, 2026
@typescript-automation typescript-automation Bot moved this from Needs Maintainer Review to Waiting for Author to Merge in Pull Request Status Board Jul 7, 2026
@hkleungai

Copy link
Copy Markdown
Contributor Author

Ready to merge

@typescript-automation typescript-automation Bot moved this from Waiting for Author to Merge to Recently Merged in Pull Request Status Board Jul 8, 2026
@typescript-automation
typescript-automation Bot merged commit d449cb9 into DefinitelyTyped:master Jul 8, 2026
15 checks passed
@hkleungai
hkleungai deleted the node-fs-promises-update-appendFile-writeFile-data-type branch July 8, 2026 07:45
Comment on lines -1211 to -1212
| AsyncIterable<string | NodeJS.ArrayBufferView>
| Stream,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@hkleungai It seems to be a mistake that the Stream type was removed from the data type for writeFile() here. According to the docs, it's still supported: https://nodejs.org/docs/latest/api/fs.html#fspromiseswritefilefile-data-options.

Can you please confirm that? Open to fix this myself, if I am right.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

See #75205 (comment).

There's actually no separate logic for this, Readable is allowed here as an async iterable, and is consumed as such.

There is another PR on nodejs repo, for cleaning up the doc. Still pending on maintainer's approval for the merge though. See nodejs/node#64279

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ah now I got it, thanks for the explanation.

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

Labels

Critical package Maintainer Approved Owner Approved A listed owner of this package signed off on the pull request. Self Merge This PR can now be self-merged by the PR author or an owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants