From abd80a935db8bacaa545c4c88ce05a1f576a6729 Mon Sep 17 00:00:00 2001 From: Anton Medvedev Date: Tue, 26 Jun 2018 21:59:04 +0700 Subject: [PATCH] Use @medv/prettyjson --- README.md | 20 ++++++++++---------- index.js | 4 ++-- package.json | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 56ebd1d..e78a5d5 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Pretty print JSON without passing any arguments: ``` $ echo '{"key":"value"}' | fx { - "key": "value" + "key": "value" } ``` @@ -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" ] ``` @@ -93,7 +93,7 @@ You can update existing JSON using spread operator: ``` $ echo '{"count": 0}' | fx '{...this, count: 1}' { - "count": 1 + "count": 1 } ``` @@ -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" ] ``` diff --git a/index.js b/index.js index 507d13f..ca61078 100755 --- a/index.js +++ b/index.js @@ -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 @@ -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)) } diff --git a/package.json b/package.json index 418ef00..4a1626b 100644 --- a/package.json +++ b/package.json @@ -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" } }