prettify-bru 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +11 -11
- package/index.js +1 -1
- package/package.json +6 -2
- package/src/index.js +1 -10
package/cli.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
|
|
3
|
+
import yargs from 'yargs';
|
|
4
|
+
import {go} from './index.js';
|
|
5
|
+
|
|
6
|
+
const argv = yargs(process.argv).usage(`
|
|
4
7
|
Usage: $0 [-d] path
|
|
5
8
|
|
|
6
9
|
Running the command with no arguments will modify all files
|
|
7
10
|
|
|
8
11
|
`).options({
|
|
12
|
+
d: {
|
|
13
|
+
type: 'boolean',
|
|
14
|
+
default: false
|
|
15
|
+
},
|
|
9
16
|
path: {
|
|
10
17
|
default: '.',
|
|
11
18
|
},
|
|
@@ -18,18 +25,11 @@ Running the command with no arguments will modify all files
|
|
|
18
25
|
.help()
|
|
19
26
|
.alias('h', 'help')
|
|
20
27
|
.alias('d', 'check')
|
|
21
|
-
.alias('d', 'dry-run')
|
|
22
|
-
|
|
23
|
-
const argv = yargs.argv;
|
|
28
|
+
.alias('d', 'dry-run')
|
|
29
|
+
.parse();
|
|
24
30
|
|
|
25
31
|
if (argv.h) {
|
|
26
32
|
yargs.showHelp();
|
|
27
33
|
} else {
|
|
28
34
|
go(argv.d, argv.path);
|
|
29
35
|
}
|
|
30
|
-
|
|
31
|
-
function go(argv) {
|
|
32
|
-
const module = require('./index');
|
|
33
|
-
|
|
34
|
-
module.go(argv.d, argv.path)
|
|
35
|
-
}
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prettify-bru",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Prettifies JSON and JavaScript blocks in Bruno .bru files",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bruno",
|
|
@@ -22,13 +22,17 @@
|
|
|
22
22
|
"license": "GPL-3.0-or-later",
|
|
23
23
|
"author": "Martin Joiner (http://martinjoiner.co.uk)",
|
|
24
24
|
"type": "module",
|
|
25
|
+
"files": [
|
|
26
|
+
"index.js",
|
|
27
|
+
"cli.js",
|
|
28
|
+
"src/"
|
|
29
|
+
],
|
|
25
30
|
"bin": {
|
|
26
31
|
"prettify-bru": "./cli.js"
|
|
27
32
|
},
|
|
28
33
|
"dependencies": {
|
|
29
34
|
"yargs": "15.4.1"
|
|
30
35
|
},
|
|
31
|
-
"main": "./index",
|
|
32
36
|
"scripts": {
|
|
33
37
|
"test": "test"
|
|
34
38
|
}
|