Skip to content

Conversation

@octachrome
Copy link

A very small fix to make the encoding option work in fs.readFile and fs.readFileSync. These calls will all now return a string:

fs.readFile(path, 'utf8', callback);
fs.readFile(path, {encoding: 'utf8'}, callback);
fs.readFileSync(path, 'utf8');
fs.readFileSync(path, {encoding: 'utf8'});

I added a couple of tests, and the existing tests all pass.

@brandonculver
Copy link

👍

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants