You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
What / Why
It's annoying to have to pass
--no-json
if you are doing something like: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 toundefined
and stdout is not a TTY and the result is an object.The text was updated successfully, but these errors were encountered: