1.0.25 • Published 4 months ago

nv-cli-basic v1.0.25

Weekly downloads
-
License
ISC
Repository
-
Last release
4 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-cli2liyuke-vue-templatenv-cfg-repo-db-clinv-cfg-repo-srv-clinv-cli-8-structnv-cli-abjectnv-cli-add-func-to-exptnv-cli-add-missing-asyncnv-cli-agg-md2htmlnv-cli-api-txtnv-cli-ascii-cmmn-charnv-cli-ascii-ctrl-charnv-cli-ascii-extn-charnv-cli-bit-fieldnv-cli-bordernv-cli-buildnv-cli-build-incldnv-cli-builtin-protnv-cli-cdcptnv-cli-cpp-enumnv-cli-cpt-rangenv-cli-creat-debug-handle-change-routenv-cli-creat-debug-handle-list-routenv-cli-creat-kw-split-tblnv-cli-creat-kw-state-defnv-cli-creat-nidnv-cli-creat-readmenv-cli-creat-route-tmplnv-cli-creat-simple-show-mthdnv-cli-css-groupnv-cli-check-undeclarenv-cli-chenyunv-cli-cliprojnv-cli-clsnv-cli-cls-modnv-cli-const-int-defnv-cli-const-lit-defnv-cli-creat-pgsrv-projnv-file-vfs-local-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-pg-fetchnv-pg-jrow-creat-front-bwapinv-question-answer-db-clinv-question-answer-srv-clinv-question-paper-clinv-question-paper-db-clinv-question-repo-clinv-question-repo-db-clinv-remote-cfgnv-remote-cfg-clinv-remote-translatenv-remote-translate-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-query-paper-db-clinv-query-paper-srv-clinv-remote-tree-db-clinv-remote-user-local-clinv-sess-simple-clinv-pg-mgmt-client-clinv-pg-dispersed-clinv-wp-aperson-db-clinv-wp-aperson-srv-clinv-suv-util-sprocnv-cli-pushlishnv-cli-qr-decodenv-cli-random-uanv-cli-rangize-intsnv-cli-remove-sync-awaitnv-cli-rplc-idnv-cli-rplc-strlitnv-cli-schkboxnv-cli-sctxnv-cli-simple-fsearchnv-cli-simple-routesnv-cli-simple-upldnv-cli-sortnv-cli-sradionv-cli-statenv-cli-str-combonv-cli-swinv-cli-switch
1.0.21

4 months ago

1.0.25

4 months ago

1.0.24

4 months ago

1.0.23

4 months ago

1.0.18

8 months ago

1.0.17

8 months ago

1.0.14

9 months ago

1.0.13

9 months ago

1.0.9

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago