1.0.3 • Published 9 months ago

npm-test-kadian v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

npm-test-kadian

This is a test package

目录

  • lib
    • config
      • constants // 常量
      • repoMap // 仓库地址的映射
    • core
      • commands // 命令遍历
      • create // create 命令执行逻辑
      • help // --help 命令执行逻辑
    • utils
      • file.js
  • bin

    • cli.js // 入口
  • package.json

依赖

  • commander:命令行操作
  • download-git-repo:用于下载仓库
  • inquirer@8:交互
  • ora@4:可视加载

使用

    npm install npm-test-kadian

    test-cli init

npm 依赖包开发

    npm init -y -> npm login -> npm publish ->

local test

    npm link

发布包

  • npm config set registry https://registry.npmjs.org // 切换镜像
  • npm adduser // 添加或验证用户
  • username // 输入用户名
  • password // 输入密码(不要怀疑,在这里不管你有没有输入,光标都是不会动的,输入密码后按回车就可)
  • email // 输入邮箱
  • code // 邮箱会接收一个一次性密码,输入即可

  • npm login // 登录

  • npm adduser // 忘记要不要输入这个了 看着来
  • username
  • password
  • email
  • code

  • npm publish // 发布,如果有问题,就换个名称,在 package.json 中修改 name

  • npm config set registry http://registry.npm.taobao.org/ // 最后记得切换回来

更新包

  • npm version <update_type> // 类型有:major minor patch
  • npm publish

删除/废弃包 https://blog.csdn.net/weixin_43602502/article/details/129665569

  • 删除的版本 24 小时后方可重发
  • 只有发布 72 小时之内的包可以删除

  • npm unpublish npm-test-kadian@1.0.2 删除某个版本

  • npm unpublish npm-test-kadian --force 强制删除整个包

  • npm unpublish <@scope>/@ // 删除某个版本

  • npm unpublish <@scope>/ --force // 强制删除整个包
// https://www.cnblogs.com/sanhuamao/p/16626684.html

// https://www.cnblogs.com/yang-shun/p/16405968.html   脚本形式执行 node命令