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 🙏

© 2026 – Pkg Stats / Ryan Hefner

excavator-front-cli

v1.0.4

Published

* 繁琐重复性 `npm install`loader,plugin等工作 * 库都在升级版本,如果每次都重新弄,难免会出现版本不对的错误 * 创建新项目时,经常出现错误,总要花时间去拍错

Readme

基于Node.js的前端Cli工具(创建命令行工具)

  • 繁琐重复性 npm installloader,plugin等工作
  • 库都在升级版本,如果每次都重新弄,难免会出现版本不对的错误
  • 创建新项目时,经常出现错误,总要花时间去拍错

知识点

  • package.json

    package.json文件的bin属性是一个对象,key为命令名(会生成在node_modules/.bin目录下),值为对应的执行文件

  • commander.js

    TJ开发的nodejs处理命令行的库包括解析命令和参数

    • option

      定义命令选项(长短标识符中间使用逗号、竖线、空格分隔)、描述、默认值

      command.js默认设置了两个option

      commander
          .option('-V, --version', '查看版本号')
      	.option('-h, --help', '查看帮助')
    • command

      定义子命令

    • alias

      子命令设置别名

    • usage

      使用说明

    • action

      执行命令后的回调

    • version

      设置版本号,并且查看版本号

    • description

      描述

注意

commander.js支持git风格的的子命令处理,可以根据子命令自动引导到特定格式([command]-[subcommand])命名的文件,调用command时候,第二个参数存在,且没有显示调用action

步骤

  • 验证并创建工程目录
    • 当前目录为空目录,如果工程目录和当前目录相同,则无需创建工程目录,直接拷贝模板目录,不同则先创建工程目录
    • 当前目录不为空目录,如果工程目录和当前子目录相同,则提示该目录已存在的错误,不同则创建工程目录
  • 下载git模板,然后递归拷贝所有目录到目标地址
  • 通过命令行输入动态的改变模板的文件内容,比如package.json的name、description、verison、author
  • 有颜色的显示控制台
  • 删除不必要的模板文件(待做)