feat(node/fs/promises): update data type for appendFile() & writeFile() - #75205
Conversation
|
@hkleungai Thank you for submitting this PR! This is a live comment that I will keep updated. 1 package in this PR
Code ReviewsBecause 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
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"
} |
|
🔔 @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 |
|
@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! |
|
@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? |
Renegade334
left a comment
There was a problem hiding this comment.
Awesome, thanks so much!
|
Ready to merge |
d449cb9
into
DefinitelyTyped:master
| | AsyncIterable<string | NodeJS.ArrayBufferView> | ||
| | Stream, |
There was a problem hiding this comment.
@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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Ah now I got it, thanks for the explanation.
Resolves #75147.
Also opening nodejs/node#64279 in parallel.
Please fill in this template.
pnpm test <package to test>.Select one of these and delete the others:
If changing an existing definition: