最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
nodejs 命令行参数处理模块commander
时间:2014-05-19 编辑:简简单单 来源:一聚教程网
1、安装
代码如下 | 复制代码 |
npm install commander |
2、option 解析
代码如下 | 复制代码 |
Options with commander are defined with the .option() method, also serving as documentation for the options. The example below parses args and options from process.argv, leaving remaining args as the program.args array which were not consumed by options.
|
3、自动生成help信息
代码如下 | 复制代码 |
|
当然你也可以手动生成:
代码如下 | 复制代码 |
#!/usr/bin/env node |
4、举个完整的例子
相关文章
- HTML简单购物数量小程序代码展示 10-31
- html canvas实现弹幕功能 10-31
- HTML中空格表示的意义 10-31
- html area标签解读 10-31
- html使用表单标签实现注册页面代码展示 10-31
- 使用HTML截图并保存为本地图片的代码展示 10-31