Closed tjdett closed 4 years ago
Note that FileHandle.read
won't work either, it takes an options object not a series of parameters:
https://nodejs.org/api/fs.html#fs_filehandle_read_options
However we only needed to fix readFile
for our use case and we might end up down a rabbit hole trying to fix more than we need.
Doesn't readFile take an optional object? https://nodejs.org/api/fs.html#fs_filehandle_readfile_options
@TheSpyder We will fix those asap
Doesn't readFile take an optional object? https://nodejs.org/api/fs.html#fs_filehandle_readfile_options
Yes, but it doesn't need to. It's <Object> | <string>
, and later the docs say
If
options
is a string, then it specifies the encoding.
The whole nodejs api design is just nuts 😅
Neither
FileHandle.readFile
orFileHandle.readFileWith
worked, as their definitions were incorrect.Tests have been added to verify expected behaviour.