Skip to content

Support for encoding option in fs.readFile and fs.readFileSync - #13

Open
octachrome wants to merge 1 commit into
vojtajina:masterfrom
octachrome:master
Open

Support for encoding option in fs.readFile and fs.readFileSync#13
octachrome wants to merge 1 commit into
vojtajina:masterfrom
octachrome:master

Conversation

@octachrome

Copy link
Copy Markdown

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
Copy Markdown

👍

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