cliclicli
clicli-cli for clicliPure
Last updated 5 months ago by gpdife .
ISC · Original npm · Tarball · package.json
$ cnpm install cliclicli 
SYNC missed versions from official npm registry.

cliclicli脚手架

创建npm目录

mkdir cliclicli
cd cliclicli
npm init

安装相关依赖

  • chalk 终端字符串样式库
  • commander node.js 命令行接口的完整解决方案
  • download-git-repo 用Node.js载并提取一个git仓库(GitHub,GitLab,Bitbucket)
  • inquirer 常见的交互式命令行用户界面的集合
  • ora 优雅的终端Loding
  • shelljs Node.js复用Unix Shell命令
  • yargs 解析命令行参数

编写代码

新建command.js, package.json中新增bin字段

{
  "name": "cliclicli",
  "version": "0.0.1",
  "description": "clicli-cli for clicliPure",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "bin": {
    "cliclicli": "command.js"
  },
  "keywords": [
    "cliclicli"
  ],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "chalk": "^3.0.0",
    "commander": "^4.1.0",
    "download-git-repo": "^3.0.2",
    "inquirer": "^7.0.3",
    "joao-cli": "0.0.6",
    "ora": "^4.0.3",
    "shelljs": "^0.8.3",
    "yargs": "^15.1.0"
  }
}

command.js一定要以#!/usr/bin/env node开头,才能正常执行

本地调试

npm link

发布包

npm publish

注意: 切换到npm镜像

遇到git clone速度慢解决方案

在网站 https://www.ipaddress.com/ 解析地址 github.global.ssl.fastly.net github.com

Windows上的hosts文件路径在C:\Windows\System32\drivers\etc\hosts Mac/Linux的hosts文件路径在:sudo vim /etc/hosts

Vim /etc/hosts #此处应该是你本地解析出来的地址 199.232.5.??? github.global.ssl.fastly.net 192.30.253.??? github.com

刷线dns即可 Windows刷新dns: ipconfig /flushdns Linux刷新dns: systemctl restart nscd 或者 /etc/init.d/nscd restart Mac刷新dns: [最新的 OS X Mountain Lion or Lion 上刷新DNS] sudo killall -HUP mDNSResponder [较新的苹果Mac OS X系统刷新DNS] type dscacheutil -flushcache [比较老的刷新DNS] lookupd -flushcache

Current Tags

  • 0.0.8                                ...           latest (5 months ago)

8 Versions

  • 0.0.8                                ...           5 months ago
  • 0.0.7                                ...           5 months ago
  • 0.0.6                                ...           5 months ago
  • 0.0.5                                ...           5 months ago
  • 0.0.4                                ...           5 months ago
  • 0.0.3                                ...           5 months ago
  • 0.0.2                                ...           5 months ago
  • 0.0.1                                ...           5 months ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 1
Dependencies (8)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |