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

Doc: readable npm vs node version #94

Open
Sozialarchiv opened this issue Apr 19, 2022 · 3 comments
Open

Doc: readable npm vs node version #94

Sozialarchiv opened this issue Apr 19, 2022 · 3 comments

Comments

@Sozialarchiv
Copy link
Contributor

In the doc the following import is mentioned:

import { Readable } from 'readable-stream'

As fare as I tested it the node implementation is working without any problems.

import {Readable} from 'stream';

Maybe it is worth to mention this in the doc.

@tpluscode
Copy link
Collaborator

readable-stream is used because stream is a built-in node module which needs different treatment in web environment. The former, however, is installed from npm like everything else and will be handled by webpack, etc

@Sozialarchiv
Copy link
Contributor Author

readable-stream is used because stream is a built-in node module which needs different treatment in web environment.

I wanted to write that users who use Node don't need the npm package. At least that's how it is for me. Or is that wrong?

@tpluscode
Copy link
Collaborator

Not wrong, of course. I can add a note if you think that will be helpful

I meant that I prefer readable-stream because this way there is no need to differentiate code for node/web. Hence the example snippet should work for both.

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

No branches or pull requests

2 participants