Skip to content

Prevent deprecation warning in node 7.4.0 - #11

Merged
tmpvar merged 1 commit into
tmpvar:masterfrom
borisdiakur:master
Jan 27, 2017
Merged

Prevent deprecation warning in node 7.4.0#11
tmpvar merged 1 commit into
tmpvar:masterfrom
borisdiakur:master

Conversation

@borisdiakur

Copy link
Copy Markdown
Contributor

Closes #10

@eush77

eush77 commented Jan 19, 2017

Copy link
Copy Markdown
Collaborator

I think that the callback should check and throw any potential errors instead of just silencing them.

@borisdiakur

borisdiakur commented Jan 19, 2017

Copy link
Copy Markdown
Contributor Author

@eush77 How about printing a warning as an alternative? This wouldn’t change the current behaviour of the module (at least not drastically).

@eush77

eush77 commented Jan 19, 2017

Copy link
Copy Markdown
Collaborator

I don't think printing would be wise here since it leaves no way to handle the error and can mess up with the repl prompt. And this module already throw errors related to the history file since it uses openSync and closeSync.

Alternatively, would you feel positive about changing write to writeSync here?

@borisdiakur

Copy link
Copy Markdown
Contributor Author

@eush77 The fs docs say:

Note that it is unsafe to use fs.write multiple times on the same file without waiting for the callback. For this scenario, fs.createWriteStream is strongly recommended.

So I would actually follow the recommendation and use fs.createWriteStream. What do you think?

@borisdiakur

Copy link
Copy Markdown
Contributor Author

Ping (mr is ready to merge).

@tmpvar
tmpvar merged commit 589410f into tmpvar:master Jan 27, 2017
@tmpvar

tmpvar commented Jan 27, 2017

Copy link
Copy Markdown
Owner

thanks - published 0.1.4

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.

3 participants