1. Install CLI-VUE
NPM the install -g @ VUE / CLI
https://cli.vuejs.org/zh/guide/cli-service.html
2.npm init -y initialization packet
cyp:
#!/usr/bin/env node console.log("hello cyp");
package.json
{
"name": "vue-cli",
"version": "1.0.0",
"description": "",
"bin": {
"yd": "./bin/cyp" //插入这行代码
},
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
sudo npm link / npm link: The link to the global packet to the
4. npm install -g cyp: this can be contracted out to other people with friends
cyp:
#!/usr/bin/env node
// console.log("hello cyp");
//核心处理命令行
const program = require("commander") //cnpm install commander --save 安装包
program.version = ("0.0.1", "-v --version"); //cyp -v
cyp:
#!/usr/bin/env node
// console.log("hello cyp");
//核心处理命令行
const program = require("commander") //cnpm install commander --save 安装commander包
// console.log("xxx")
program.version("0.0.1", "-v, --version"); //cyp -v
program.command("init", "初始化我们的项目");
program.parse(process.argv);
7. The package for the gradation of characters: the install -save @ darkobits NPM / lolcatjs
https://www.npmjs.com/search?q=lolcat
lolcat
https://www.npmjs.com/package/@darkobits/lolcatjs
npm install -g @darkobits/lolcatjs
cyp:
#!/usr/bin/env node
// console.log("hello cyp");
//核心处理命令行
const program = require("commander") //cnpm install commander --save 安装commander包
//处理当用户进行版本号控制的时候
const Printer = require('@darkobits/lolcatjs');
// console.log("xxx")
program.version(Printer.default.fromString("hello world 加油,云苹"), "-v, --version"); //cyp -v
program.command("init", "初始化我们的项目");
program.parse(process.argv);