-
Notifications
You must be signed in to change notification settings - Fork 518
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
Bunyan CLI weirdly suppresses output from node's readline.prompt()
- mute-stream
and read
therefore don't work correctly with bunyan
#682
Comments
Found the problem that's causing it in the bunyan CLI (
|
A way to fix it?Created a PR #683
Resultsvar read = require('read');
const logger = bunyan.createLogger({name: 'read'})
logger.info("1) Before read")
read({
prompt: "Enter password:",
silent: true // this should make sure that the text the user types remains hidden
}, (err, res) => {
logger.info(`2) Entered password: ${res}`)
logger.info(`3) Password has been entered`)
}) The above code now performs better than before:
Although the password ( |
I'm using a npm package called read for silently reading passwords from stdin. When bunyan CLI is used for parsing the output, it gets a little bit broken
Code to reprouce:
The incorrect output of the code above (notice the visible passw0rd123):
The expected output:
What breaks bunyan
I've looked into the
read
's source code and found out what part actually breaks bunyan: node's readline -.prompt()
.The "error" can be reproduced with this code:
The incorrect output of the code above:
The expected output:
The text was updated successfully, but these errors were encountered: