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

[FEATURE] bin: don't JSON.stringify by default when return value isn't an object #17

Closed
isaacs opened this issue Nov 10, 2019 · 2 comments

Comments

@isaacs
Copy link
Contributor

isaacs commented Nov 10, 2019

What / Why

It's annoying to have to pass --no-json if you are doing something like:

curl $(pacote resolve pkgname) | tar tv

There's no need to automatically JSON.stringify on non-tty output unless it's an object. The more expected pattern is to just pass strings on through as-is.

Instead of defaulting --json to !process.stdout.isTTY, leave it as undefined, and only console.log json if it's set explicitly to true, or set to undefined and stdout is not a TTY and the result is an object.

@isaacs isaacs changed the title [FEATURE] don't JSON.stringify by default when return value isn't an object [FEATURE] bin: don't JSON.stringify by default when return value isn't an object Nov 10, 2019
@HERBOD7
Copy link

HERBOD7 commented Nov 10, 2019

@isaacs I can do it.

@isaacs isaacs closed this as completed in f28888e Nov 27, 2019
@isaacs
Copy link
Contributor Author

isaacs commented Nov 27, 2019

Sorry, I got too frustrated by having to strip the " off of strings in the output when debugging stuff. Couldn't wait any longer.

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