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

mics-generate-components

v0.0.5

Published

生成文件夹组件

Readme

脚手架工具:初始化生成项目文件夹及其组件内容

安装

npm install mics-generate-components

配置

在项目根目录下的package.json里的script配置如下该命令行:

 {
  "scripts": {
    "generate":"mics-generate-components -n"
  }
 }

运行

在项目根目录下,打开终端命令行,运行如下命令:

npm run generate MicsRadarChart

或者

npm run generate MicsRadar

即可实现

在根目录下的./src/package/MicsRadarChart下生成index.vue和index.ts ;

在根目录下的./src/views/inspector/MicsRadarChart下生成index.vue。

使用Tip

  1. 传入变量名必须符合驼峰命名,并且要以Mics开头
  2. 必须在项目根目录下执行

命令

mics-generate-components <command> [option]

mgc <command> [option]

  1. command

    help 打印帮助内容

  2. OPTIONS

    -c , --clear 清空控制台 -v , --version 查看版本号 -n , --name 需要生成的组件文件名字

脚手架已经实现的校验功能

  1. 可以校验传入指令的name是否符合驼峰命令,并给予提示

  2. 可以校验是否在根目录下运行该命令,并给予提示

    当不在项目根目录下运行该命令时,会给出提示,防止生成文件放错位置

  3. 可以校验对应文件夹下的index.vue和index.ts是否存在(防止覆盖文件),并给予提示

  4. 可以校验对应文件夹是否存在,防止文件夹重名

后续TODO

  1. 将生成路径变成参数动态传入

  2. 将模板文件变成动态读取

通过上述两点的操作,就可以完成适配多项目下生成相同的文件夹及其内容