Skip to content

Commit

Permalink
issue trentm#36: Would like ability to use -i with color disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
trentm committed Aug 15, 2012
1 parent 3eeadd1 commit 00af185
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Expand Up @@ -3,7 +3,8 @@

## json 4.0.1 (not yet released)

(nothing yet)
- [issue #36] Turn off coloring for inspect output (`json -i`, `json -o
inspect`) if stdout is not a TTY.


## json 4.0.0
Expand Down
2 changes: 1 addition & 1 deletion lib/jsontool.js
Expand Up @@ -710,7 +710,7 @@ function printDatum(datum, opts, sep, alwaysPrintSep) {
var output = null;
switch (opts.outputMode) {
case OM_INSPECT:
output = util.inspect(datum, false, Infinity, true);
output = util.inspect(datum, false, Infinity, process.stdout.isTTY);
break;
case OM_JSON:
if (typeof datum !== 'undefined') {
Expand Down

0 comments on commit 00af185

Please sign in to comment.