npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nv-cli-basic

v1.0.25

Published

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

Downloads

29

Readme

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