memory-fs icon indicating copy to clipboard operation
memory-fs copied to clipboard

readFile does not seem to accept options object

Open turnerhayes opened this issue 7 years ago • 2 comments

When I run fs.readFile(somePath, { encoding: "utf8" }, (err, content) => {}), which (I think) works with the native Node fs module, it throws an error TypeError: Unknown encoding: [object Object]. It seems to work if I just pass "utf8", rather than an object.

turnerhayes avatar Feb 10 '18 02:02 turnerhayes

@turnerhayes This issue should have existed until this #39 was merged. Since its was merged long back I think this issue is not valid anymore.Thanks!

Viijay-Kr avatar May 02 '18 09:05 Viijay-Kr

I can confirm that this issue still exists.

This doesn't work:

fs.readFile(filepath, { encoding: 'utf8' })

This does work:

fs.readFile(filepath, 'utf8')

mpetrovich avatar Aug 10 '19 22:08 mpetrovich