Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

docs: Fix signature of fs.readFile to include encoding#558

Merged
alexandrtovmach merged 3 commits into
nodejs:masterfrom
dahmian:patch-1
Apr 25, 2020
Merged

docs: Fix signature of fs.readFile to include encoding#558
alexandrtovmach merged 3 commits into
nodejs:masterfrom
dahmian:patch-1

Conversation

@dahmian

@dahmian dahmian commented Apr 16, 2020

Copy link
Copy Markdown
Contributor

Documentation states that the default encoding is utf8, but the default character encoding is null. If the example code is run, it returns the raw buffer.

https://nodejs.org/api/fs.html#fs_fs_readfile_path_options_callback

Default character encoding is null, encoding must be specified or it returns the raw buffer.

https://nodejs.org/api/fs.html#fs_fs_readfile_path_options_callback

@alexandrtovmach alexandrtovmach left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

@alexandrtovmach

Copy link
Copy Markdown
Contributor

/gcbrun

Comment thread src/documentation/0043-node-reading-files/index.md Outdated
@alexandrtovmach

Copy link
Copy Markdown
Contributor

/gcbrun

@alexandrtovmach alexandrtovmach merged commit b8ce82c into nodejs:master Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants