1.1.1 • Published 3 months ago

nv-cli-basic v1.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
3 months ago

nv-cli-basic

  • nv-cli-basic
  • for creat cli project
  • similiar to minimist, more simple

install

  • npm install nv-cli-basic

usage

const creat_argv = require("nv-cli-basic");

example

bin.js

#!/usr/bin/env node

const creat_argv = require("nv-cli-basic");

var cfg = {
    alias: {
        'efi':'e',
        'disabled':'d',
        'count':'c',
        'name':'n'
    },
    boolean: ["disabled"],
    string:  ["name"],
    defaults: {
        'count':1000
    },
    description: {
        'efi':'efi params',
        'disabled':'if the control-plane is disabled',
        'name':'the name,always treated as string',
        'count':'testing times, default 1000'
    }
}


var argv = creat_argv(cfg)

console.log(argv);

console.log("--generated usage: ----")

console.log(argv.usage("projname"));


console.log("---please input and then ctrl-D ---")

function handler(s) {
    return(s.split("\n").join(" @@@@ "))
}

argv.rwstream(handler);

output

# node bin.js xy "b c d" -e fgh --efi 123 "({200:300})" -g ggg -n 55555555


Argv {
  efi: [ 123, { '200': 300 } ],
  g: 'ggg',
  name: '55555555',
  _: [ 'xy', 'b c d' ],
  e: [ 123, { '200': 300 } ],
  n: '55555555',
  disabled: false,
  d: false,
  count: 1000,
  c: 1000
}
--generated usage: ----
Usage: projname [options]
Options:
    -e, --efi             efi params
    -d, --disabled        if the control-plane is disabled
    -n, --name            the name,always treated as string
    -c, --count           testing times, default 1000

---please input and then ctrl-D ---

aaa
bbb
ccc
ddd
 @@@@ aaa @@@@ bbb @@@@ ccc @@@@ ddd @@@@

nv-cli-basic-#

METHODS

argv.alias_                argv.amd_                  argv.boolean_
argv.cfg_                  argv.constructor           argv.defaults_
argv.description_          argv.input_stream          argv.output_stream
argv.pre_post_tem          argv.rwstream              argv.string_
argv.usage

LICENSE

  • ISC
nv-cli-esdefnv-cli-back-nvproj@infinitebrahmanuniverse/nolb-nvnv-session-simple@everything-registry/sub-chunk-2358csnpm-cli2nv-event-target-tree-patch-clinv-suv-util-sprocnv-wp-aperson-db-clinv-wp-aperson-srv-clinv-file-vfs-local-clinv-pg-mgmt-client-clinv-pg-mgmt-srv-clinv-pg-nofix-clinv-pg-nofix-cmd-count-clinv-pg-nofix-cmd-delete-clinv-pg-nofix-cmd-desc-clinv-pg-nofix-cmd-insert-clinv-pg-nofix-cmd-random-insertnv-pg-nofix-cmd-select-clinv-pg-nofix-cmd-update-clinv-macro-lexblknv-macro-lexvarnv-macro-quotenv-macro-simple-gotonv-macro-wsnv-minio-srv-clinv-pg-fetchnv-pg-jrow-creat-front-bwapinv-loan-admin-db-clinv-log-app-crash-db-clinv-log-app-crash-srv-clinv-log-back-crash-db-clinv-log-back-crash-srv-clinv-pg-dispersed-clinv-pg-dispersed-cmd-count-clinv-pg-dispersed-cmd-delete-clinv-pg-dispersed-cmd-desc-clinv-pg-dispersed-cmd-insert-clinv-pg-dispersed-cmd-random-insertnv-pg-dispersed-cmd-select-clinv-pg-dispersed-cmd-update-clinv-loan-admin-srv-clinv-query-paper-db-clinv-query-paper-srv-clinv-question-answer-db-clinv-remote-translatenv-remote-translate-clinv-remote-tree-db-clinv-remote-user-local-clinv-sess-simple-clinv-question-answer-srv-clinv-question-paper-clinv-question-paper-db-clinv-question-repo-clinv-question-repo-db-clinv-remote-cfgnv-remote-cfg-clinv-cli-find-idnv-cli-find-lgcexprnv-cli-find-strlitnv-cli-find-undefnv-cli-flat-algnnv-cli-forswnv-cli-fsplitnv-cli-fullfill-pathnv-cli-gir-leaf0nv-cli-gir-s0nv-cli-groupnv-cli-hoist-strlitnv-cli-how-many-procsnv-cli-how-many-workersnv-cli-hsrvnv-cli-http-codenv-cli-if-constexpr-branchnv-cli-if-constexpr-mirrnv-cli-if-constexpr-timapnv-cli-ifelnv-cli-ififnv-cli-ignorenv-cli-imptnv-cli-includenv-cli-inspector-protnv-cli-installnv-cli-iter-ctxnv-cli-jfsgnv-cli-jparam-combonv-cli-jsbeaunv-cli-linux-bashrc-quick-cdnv-cli-linux-cpnv-cli-linux-fsortnv-cli-linux-lsofnv-cli-linux-psefnv-cli-log-catch-paramnv-cli-loopnv-cli-mach-tmplnv-cli-many-blocknv-cli-many-funcsnv-cli-many-gvarnv-cli-mcr-map
1.1.1

3 months ago

1.1.0

3 months ago

1.0.26

5 months ago

1.0.21

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.9

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago