npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mine-auto-cli

v2.6.0

Published

一个将多个命令简化成一个命令的工具 😆

Downloads

90

Readme

mine-auto-cli

一个将多个命令简化成一个命令的工具 😆

特性

全局安装

npm i -g mine-auto-cli

使用

查看版本

auto -v

查看所有命令

auto -h

初始化配置文件

  • 自动生成初始化 auto-cli.jsonc 文件
  • 带上 -y 或者 --yml 生成 auto-cli.yml
  • 如果两个文件都存在,则合并优先于 auto-cli.jsonc 文件
  • 初始化的所有字段仅是默认值和可选值,可以自定义删除
auto init
  • 字段解析:

    • prefix: 版本前缀,默认为 ^
    • registry: 依赖来源,默认为 https://registry.npmmirror.com/
    • check: 是否更新 package.json 文件,为 true 时等同于 auto check -u, -u 优先级最高, 默认为 false
    • reject: 拒绝检查的依赖,默认为 []
    • resolve: 指定版本检查的标签,默认为 [],例如:['mine-auto-cli@beta'],默认标签为 latest
    • comment: 配置依赖解析说明预设
  • auto-cli.jsonc

{
  "prefix": "^",
  "registry": "https://registry.npmmirror.com/",
  "check": false,
  "reject": [],
  "resolve": [],
  "comment": {}
}
  • auto-cli.yml
prefix: ^
registry: https://registry.npmmirror.com/
check: false
reject: []
resolve: []
comment: {}

简化 Git 提交命令

auto git [描述]
# 等同于
git add -A
git commit -m [描述]
git push

简化打包提交命令

auto build[:环境] [描述]
# 等同于
npm run build:staging
git add -A
git commit -m [描述]
git push

简化手动更改版本号命令

# 版本号自增
auto version++
# 或者指定具体的版本号
auto [email protected]

生成工作目录结构文件

  • 可以在工作目录生成 directory.md 文件
auto mkdir
  • directory.md
├── mine-auto-cli
│    ├── src
│    │    └── commander
└    └── README.md
  • 通过 -l, --line 生成的结构文件带横线,默认数量为 20
  • 通过 -n, --name 自定义生成的结构文件名称,默认名称为 directory
auto mkdir -l 10 -n demo
  • demo.md
├── mine-auto-cli  ----------------------
│    ├── src  ---------------------------
│    │    └── commander -----------------
└    └── README.md ----------------------

检查 package.json 依赖版本

auto check

img

生成依赖注释文件

  • 可以在工作目录生成 comment.md 文件
auto comment
  • comment.md
  • 可以在 auto-cli.jsonc 配置 comment 用来设置预设值,不设置的话默认为空
### 依赖解析

#### dependencies

- `mine-h5-ui`:

#### devDependencies

- `mine-auto-cli`:

#### optionalDependencies

- `@rollup/rollup-linux-x64-gnu`:

更新 .vscode 文件

auto vscode-config

切换 Node 版本

  • 基于 nvm 快速切换 node 版本
  • 当我们运行的项目过多并且版本还不一致时,此命令可以用于快速切换
  • 默认选择第一个版本号
# 命令
auto node [版本号]
# 切换为 20 开头的版本
auto node 20
# 切换为 20.12.1 的版本
auto node 20.12.1

技术栈

  • Vite + TypeScript + NodeJs

依赖解析

dependencies

  • chalk: 字体颜色
  • commander: 命令
  • download-git-repo: 下载 Git 仓库
  • inquirer: 用户交互
  • js-yaml: 解析 .yml 文件
  • log-symbols: 图标
  • ora: 动画效果
  • pacote: 包信息请求器
  • semver-utils: 解析包版本
  • strip-json-comments: 移除 json 注释
  • update-notifier: 检查更新

devDependencies

  • @types/js-yaml: js-yaml 类型
  • @types/node: node 类型
  • @types/pacote: pacote 类型
  • @types/semver-utils: semver-utils 类型
  • @types/update-notifier: update-notifier 类型
  • prettier: 格式化工具
  • typescript: 编程语言
  • vite: 项目构建工具

贡献者们

贡献者们