1.0.7 • Published 4 years ago

argv_store v1.0.7

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

argv_store

node命令行管理,操作参数以及对应的方法实现

使用

内部方法

方法名解释参数
version添加对应模块版本version(string)
command添加命令方法(方法名, 解释信息, 调用方法)
options添加命令的参数, 使用前必须存在command(参数名, 解释信息)
parse执行方法(必须调用)null

code

const program = new argvStore();

const test = function() {
    // 获取到的输入的参数
    console.log(this.argv);
    // 直接获取keyMap,即option以及他对应的参数
    getKeyMap()
}

program
    .version(packageJson.version)
    .command('build', '构建', build)
    .options('-b --build', '构建参数')
    .options('-c --client', '构建参数', test)
    .command('dev', '开发', devServer)
    .parse();
1.0.7

4 years ago

1.0.6

4 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