命令行工具
$ npm i -g @flowx/npm-cli
$ npc registry [-d|--delete]
$ npm i -g @flowx/npm-cli
$ npc r
# type the registry url and select yes to confirm
# test:
$ npc view react
$ npc use
你可以选择使用npm
或者npminstall
模式来安装模块。默认选择npm
。
任意存在 .npc
文件夹下以 .cmd.js
结尾的文件都将被认为是插件。插件写法如下:
const { Command } = require('commander');
const c = module.exports = new Command();
c.name('aa')
c.action(() => {
console.log('bb')
})
它将自动被npc加载:
$ npc aa # bb
搜索目录:
node_modules
下所有插件process.cwd()
同级.npc
文件夹