Skip to content
This repository was archived by the owner on Jul 8, 2023. It is now read-only.

Commit 6213f19

Browse files
committed
Use idempotent JSON output.
1 parent 8f12afa commit 6213f19

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

lib/cli.js

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
},
3535
"dependencies": {
3636
"bluebird": "^3",
37+
"json-stable-stringify": "^1",
3738
"readdirp": "^2"
3839
},
3940
"optionalDependencies": {

src/cli.coffee

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
jsonStringify = require 'json-stable-stringify'
2+
13
module.exports = (_process, _console, builder = require '.') ->
24
argv = _process.argv.slice 2
35

@@ -8,6 +10,6 @@ module.exports = (_process, _console, builder = require '.') ->
810

911
return builder.build argv[0]
1012
.then (result) ->
11-
return _console.log JSON.stringify result, null, 2
13+
return _console.log jsonStringify result, space: 2
1214
.catch (error) ->
1315
return _console.error error.toString()

0 commit comments

Comments
 (0)