fs: support Uint8Array input to methods#10382
Conversation
Allow `fs.read`, `fs.write` and `fs.writeFile` to take `Uint8Array` arguments.
|
Does |
Yes and yes; |
|
Sorry, I'm not able to review this right now, but I wanted to express a heavy +1 for this change. |
|
Landed in f2ef850 |
Allow `fs.read`, `fs.write` and `fs.writeFile` to take `Uint8Array` arguments. PR-URL: #10382 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
|
@addaleax this lands cleanly on v7.x but the cherry-pick isn't bring over the changes to src/node_util.cc for some reason? I keep getting this error when trying to run tests: Mind submitting a backport PR for it? |
|
Ah scratch that, looks like it depends on #10236 which is semver-major. |
Allow `fs.read`, `fs.write` and `fs.writeFile` to take `Uint8Array` arguments. PR-URL: nodejs#10382 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
Done: #10593 |
Notable changes: * buffer: - Improve performance of Buffer allocation by ~11% (Brian White) #10443 - Improve performance of Buffer.from() by ~50% (Brian White) #10443 * events: Improve performance of EventEmitter.once() by ~27% (Brian White) #10445 * fs: Allow passing Uint8Array to fs methods where Buffers are supported. (Anna Henningsen) #10382 * http: Improve performance of http server by ~7% (Brian White) #6533 * npm: Upgrade to v4.0.5 (Kat Marchán) #10330 PR-URL: #10589
Notable changes: * buffer: - Improve performance of Buffer allocation by ~11% (Brian White) #10443 - Improve performance of Buffer.from() by ~50% (Brian White) #10443 * events: Improve performance of EventEmitter.once() by ~27% (Brian White) #10445 * fs: Allow passing Uint8Array to fs methods where Buffers are supported. (Anna Henningsen) #10382 * http: Improve performance of http server by ~7% (Brian White) #6533 * npm: Upgrade to v4.0.5 (Kat Marchán) #10330 PR-URL: #10589
Notable changes:
* buffer:
- Improve performance of Buffer allocation by ~11% (Brian White) nodejs/node#10443
- Improve performance of Buffer.from() by ~50% (Brian White) nodejs/node#10443
* events: Improve performance of EventEmitter.once() by ~27% (Brian White) nodejs/node#10445
* fs: Allow passing Uint8Array to fs methods where Buffers are supported. (Anna Henningsen) nodejs/node#10382
* http: Improve performance of http server by ~7% (Brian White) nodejs/node#6533
* npm: Upgrade to v4.0.5 (Kat Marchán) nodejs/node#10330
PR-URL: nodejs/node#10589
Signed-off-by: Ilkka Myller <ilkka.myller@nodefield.com>
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
fs
Description of change
Allow
fs.read,fs.writeandfs.writeFileto takeUint8Arrayarguments./cc @nodejs/fs
CI: https://ci.nodejs.org/job/node-test-commit/6765/