1.0.7 • Published 1 year ago
nv-cli-include v1.0.7
nv-cli-include
- cli-tool
- let you use a #include-like behavior
install
- npm install nv-cli-include -g
usage
Usage: nv_cli_include [options]
Options:
-w, --workdir workdir, default "./"
-c, --worker_cnt_per_cpu worker count per cpu, default 8
-h, --help usage
syntax:
##include("<your-macro-file-path-end-with nvmcr.js>");
example
# tree TEST/
TEST/
├── index.js
└── macros
├── m0.nvmcr.js
└── m1.nvmcr.js
1 directory, 3 files
# cat TEST/index.js
function main(a,b) {
##include("./macros/m0.nvmcr.js");
++a;
--b;
##include("./macros/m1.nvmcr.js");
return([a,b])
}
# cat TEST/macros/m0.nvmcr.js
a = a+1;
b = b+2;
e# cat TEST/macros/m1.nvmcr.js
a = a*2;
b = b*4;
# nv_cli_include -w "./TEST"
# cat TEST/index.js
function main(a, b) {
a = a + 1;
b = b + 2;
++a;
--b;
a = a * 2;
b = b * 4;
return [a, b];
}
LICENSE
- ISC