Skip to content

Commit

Permalink
fs.readFile default encoding is null, not utf8
Browse files Browse the repository at this point in the history
  • Loading branch information
taitulism committed Apr 11, 2014
1 parent ad6c96d commit a9aa2c6
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -5,7 +5,7 @@ Reading the contents of a file into memory is a very common programming task, an

// file = (string) filepath of the file to read

`encoding` is an optional parameter that specifies the type of encoding to read the file. Possible encodings are 'ascii', 'utf8', and 'base64'. If no encoding is provided, the default is `utf8`.
`encoding` is an optional parameter that specifies the type of encoding to read the file. Possible encodings are 'ascii', 'utf8', and 'base64'. If no encoding is provided, the default is `null`.

`callback` is a function to call when the file has been read and the contents are ready - it is passed two arguments, `error` and `data`. If there is no error, `error` will be `null` and `data` will contain the file contents; otherwise `err` contains the error message.

Expand Down

0 comments on commit a9aa2c6

Please sign in to comment.