Skip to content

Commit

Permalink
Use @medv/prettyjson
Browse files Browse the repository at this point in the history
  • Loading branch information
antonmedv committed Jun 26, 2018
1 parent 51bb5d9 commit abd80a9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
20 changes: 10 additions & 10 deletions README.md
Expand Up @@ -31,7 +31,7 @@ Pretty print JSON without passing any arguments:
```
$ echo '{"key":"value"}' | fx
{
"key": "value"
"key": "value"
}
```

Expand Down Expand Up @@ -72,17 +72,17 @@ Access to JSON through `this` keyword:
```
$ echo '["a", "b"]' | fx 'yield* this'
[
"a",
"b"
"a",
"b"
]
```

```
$ echo '["a", "b"]' | fx 'yield* this; yield "c";'
[
"a",
"b",
"c"
"a",
"b",
"c"
]
```

Expand All @@ -93,7 +93,7 @@ You can update existing JSON using spread operator:
```
$ echo '{"count": 0}' | fx '{...this, count: 1}'
{
"count": 1
"count": 1
}
```

Expand Down Expand Up @@ -125,9 +125,9 @@ Convert object to array:
```
$ cat package.json | fx 'Object.keys(this.dependencies)'
[
"get-stdin",
"jsome",
"meow"
"@medv/prettyjson",
"get-stdin",
"meow"
]
```

Expand Down
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -2,7 +2,7 @@
'use strict'
const meow = require('meow')
const stdin = require('get-stdin')
const jsome = require('jsome')
const pretty = require('@medv/prettyjson')

const cli = meow(`
Usage
Expand Down Expand Up @@ -35,7 +35,7 @@ async function main() {
if (typeof result === 'undefined') {
process.stderr.write('undefined\n')
} else if (process.stdout.isTTY) {
jsome(result)
console.log(pretty(result))
} else {
console.log(JSON.stringify(result, null, 2))
}
Expand Down
12 changes: 6 additions & 6 deletions package.json
Expand Up @@ -23,13 +23,13 @@
"node": ">=8"
},
"dependencies": {
"get-stdin": "^5.0.1",
"jsome": "^2.5.0",
"meow": "^4.0.0"
"@medv/prettyjson": "^1.0.0",
"get-stdin": "^6.0.0",
"meow": "^5.0.0"
},
"devDependencies": {
"ava": "^0.24.0",
"pkg": "^4.3.0",
"release-it": "^6.1.1"
"ava": "^0.25.0",
"pkg": "^4.3.3",
"release-it": "^7.4.7"
}
}

0 comments on commit abd80a9

Please sign in to comment.