Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createReadStream cannot trigger 'ready' event after use graceful-fs #152

Open
XGHeaven opened this issue Jan 9, 2019 · 0 comments · May be fixed by #173
Open

createReadStream cannot trigger 'ready' event after use graceful-fs #152

XGHeaven opened this issue Jan 9, 2019 · 0 comments · May be fixed by #173

Comments

@XGHeaven
Copy link

XGHeaven commented Jan 9, 2019

Example:

const { createReadStream } = require('fs')
createReadStream('./package.json')
    .on('open', () => console.log('open1'))
    .on('ready', () => console.log('ready1'))

require('graceful-fs')

createReadStream('./package.json')
    .on('open', () => console.log('open2'))
    .on('ready', () => console.log('ready2'))

setTimeout(() => {}, 1000) // wait a second

output:

open1
ready1
open2

No ready2 output!
You can copy above code in node repl to reproduce.

And If you comment require('graceful-fs').ready2 is printed.

  • package version: 4.1.15
  • node version: 11.6.0
@coreyfarrell coreyfarrell linked a pull request Aug 11, 2019 that will close this issue
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 a pull request may close this issue.

1 participant