Skip to content
This repository was archived by the owner on Jun 5, 2020. It is now read-only.

update fs.{read,write}File{,Sync} decls #6

Merged
merged 1 commit into from
Aug 23, 2014
Merged

Conversation

keunwoo
Copy link

@keunwoo keunwoo commented Aug 23, 2014

In current (0.10.31) node, these functions take an options object as
their second parameter, not a string. I'm not sure when this was
changed, although I think it happened many versions ago.

http://nodejs.org/api/fs.html#fs_fs_readfile_filename_options_callback
http://nodejs.org/api/fs.html#fs_fs_readfilesync_filename_options
http://nodejs.org/api/fs.html#fs_fs_writefile_filename_data_options_callback
http://nodejs.org/api/fs.html#fs_fs_writefilesync_filename_data_options

The string form has been left as an alternative for users who are using
old versions of node.

npm test has been run on this commit.

In current (0.10.31) node, these functions take an options object as
their second parameter, not a string.  I'm not sure when this was
changed, although I think it happened many versions ago.

http://nodejs.org/api/fs.html#fs_fs_readfile_filename_options_callback
http://nodejs.org/api/fs.html#fs_fs_readfilesync_filename_options
http://nodejs.org/api/fs.html#fs_fs_writefile_filename_data_options_callback
http://nodejs.org/api/fs.html#fs_fs_writefilesync_filename_data_options

The string form has been left as an alternative for users who are using
old versions of node.
dcodeIO added a commit that referenced this pull request Aug 23, 2014
update fs.{read,write}File{,Sync} decls
@dcodeIO dcodeIO merged commit 26f68f0 into dcodeIO:master Aug 23, 2014
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