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

piped streams are truncated when keypress is loaded #13

Open
rodw opened this issue Feb 11, 2015 · 0 comments
Open

piped streams are truncated when keypress is loaded #13

rodw opened this issue Feb 11, 2015 · 0 comments

Comments

@rodw
Copy link

rodw commented Feb 11, 2015

Over at request/request I documented an issue that is looking increasingly like a problem in keypress rather than the request module.

In a nutshell:

Given this program:

require("keypress")(process.stdin);
var request = require('request');
request.get("https://github.com/request/request/issues/511").pipe(process.stdout);

The command:

node foo.js

prints the entire document, but the command

node foo.js | cat

is truncated after 1024 characters with this error:

stream.js:94
      throw er; // Unhandled stream error in pipe.
            ^
Error: write EPIPE
    at errnoException (net.js:904:11)
    at Object.afterWrite (net.js:720:19)

Taking out the first line (the call to keypress) makes the issue go away.

I assume that this is probably true for most streams - the use of request here is probably not required to recreate the 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

No branches or pull requests

1 participant