nv-cli-fctx ===================== - nv-cli-fctx - simple cli tool, creat some templates for single-param-only style programming
npm install nv-cli-fctxnv-cli-fctx
=====================
- nv-cli-fctx
- simple cli tool, creat some templates for single-param-only style programming
- PARAMD: creat param-dict-ctx
- PRE\_CHECK: check input-paramd-ctx
- HANDLE:
- TRANS: transform to output-rtrn-ctx
- POST\_CHECK check output-rtrn-ctx
install
=======
- npm install nv-cli-fctx -g
usage
=====
Usage: nv_cli_fctx [options]
Options:
-p, --params ctx param names
-f, --funcname function name,defult="func"
-h, --help usage
example
-------
nv-cli-fctx# nv_cli_fctx -f myfunc -p a b c
function myfunc(ctx) {
myfunc.CHECK_INPUT(ctx);
//
myfunc.PARAMD = ()=>(
{
"a": null,
"b": null,
"c": null
}
);
myfunc.CHECK_INPUT = (ctx) => {
/impl checker/
let cond = /Boolean/
if(cond) {
} else {
throw(new Error(/input-check-fail/))
}
}
myfunc.TRANS = (ctx) => {
let nctx;
nctx = /impl/;
return(nctx)
}
myfunc.CHECK_OUTPUT = (ctx) => {
/impl checker/
let cond = /Boolean/
if(cond) {
} else {
throw(new Error(/output-check-fail/))
}
}
LICENSE
=======
- ISC