nv-cli-show-html 1.0.1
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/README.md +18 -0
- package/cli.js +52 -0
- package/index.js +0 -0
- package/package.json +25 -0
package/README.md
ADDED
package/cli.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const fs = require("fs");
|
|
3
|
+
const path = require("path");
|
|
4
|
+
|
|
5
|
+
const {
|
|
6
|
+
ppend_fmt_sary,
|
|
7
|
+
apend_fmt_sary
|
|
8
|
+
} = require("nv-string-basic");
|
|
9
|
+
|
|
10
|
+
const creat_argv = require("nv-cli-basic");
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
const cfg = {
|
|
15
|
+
alias: {
|
|
16
|
+
'max_depth' :'d',
|
|
17
|
+
'with_text' :'t',
|
|
18
|
+
'input' :'i',
|
|
19
|
+
'output' :'o',
|
|
20
|
+
'help' :'h',
|
|
21
|
+
},
|
|
22
|
+
description: {
|
|
23
|
+
'max_depth' :'max_depth ,default 5',
|
|
24
|
+
'with_text' :'show text node,default false',
|
|
25
|
+
'input' :'input string ,default stdin',
|
|
26
|
+
'output' :'output string,default stdout',
|
|
27
|
+
'help':"usage",
|
|
28
|
+
},
|
|
29
|
+
defaults: {
|
|
30
|
+
max_depth:5,
|
|
31
|
+
},
|
|
32
|
+
boolean: ["help","with_text"]
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
var argv = creat_argv(cfg);
|
|
39
|
+
////
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
if(argv.h) {
|
|
43
|
+
var _usage = argv.usage("nv_cli_show_html");
|
|
44
|
+
console.log(_usage)
|
|
45
|
+
} else {
|
|
46
|
+
var handler = (src)=>require("nv-html-term-paint")(src,{
|
|
47
|
+
just_show: true,
|
|
48
|
+
ignore_text: !argv.t,
|
|
49
|
+
max_depth: Number(argv.d)
|
|
50
|
+
})
|
|
51
|
+
argv.rwstream(handler,argv.i,argv.o);
|
|
52
|
+
}
|
package/index.js
ADDED
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dependencies": {
|
|
3
|
+
"nv-cli-basic": "^1.0.18",
|
|
4
|
+
"nv-cli-jfetch": "^1.0.2",
|
|
5
|
+
"nv-cli-user": "1.0.1",
|
|
6
|
+
"nv-facutil-surl": "^1.0.2",
|
|
7
|
+
"nv-file-sync-reader": "^1.0.4",
|
|
8
|
+
"nv-html-term-paint": "^1.0.1",
|
|
9
|
+
"nv-server-simple-stream": "^1.0.36",
|
|
10
|
+
"nv-string-basic": "^1.0.51",
|
|
11
|
+
"nvison": "^1.0.28"
|
|
12
|
+
},
|
|
13
|
+
"name": "nv-cli-show-html",
|
|
14
|
+
"description": "",
|
|
15
|
+
"version": "1.0.1",
|
|
16
|
+
"main": "index.js",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
19
|
+
},
|
|
20
|
+
"bin": {
|
|
21
|
+
"nv_cli_show_html": "cli.js"
|
|
22
|
+
},
|
|
23
|
+
"author": "",
|
|
24
|
+
"license": "ISC"
|
|
25
|
+
}
|