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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@nora_npm/tools

v1.0.6

Published

Collection of common tools

Readme

常用的工具合集

全局安装

npm i @nora_npm/tools -g

提示

  • 以下涉及到生成页面及路由文件,适用于 vben 5.x 框架
  • 执行命令前请确认所在目录是否正确

生成 TypeScript 文件

针对 Apifox 接口文档生成 types.ts 文件 和 接口文件 index.ts

  • 示例
nora ts -u http://127.0.0.1:4523/export/openapi/5?version=3.0 --exp
  • 参数

    | 选项 | 描述 | | - | - | | -h, --help | 获取帮助 | | --apifox | Apifox获取数据URL说明 | | -u, --url | 需要处理的接口数据链接,非windows系统请使用引号包裹url,通过apifox获取,具体获取方式执行 --apifox 命令查看 | | -a, --api-file-path | 默认值:"./api/core"。生成的types和api文件放置的路径,请使用相对路径,相对于执行命令时所在的目录,比如在src下执行 | | --exp | 默认值:关闭。是否需要在api模块集中管理中导出,默认集中管理文件为api-file-path的index.ts文件中,默认关闭 | | --pre | 生成的接口路径中,需要去掉的部分,比如:/api/home/index 去掉“api” |

快速生成 modal 页面组件

注意:

  1. 如果创建组件时组件目录中已存在 config.ts 文件,则不会创建,仅在 config.ts 中添加一个示例的 formSchema 配置
  2. 创建组件中,检测到该目录下存在相同命名组件,会提示更新组件名,此时输入新的组件名回车即可
  • 示例
nora cr -t modal --vp ./index.vue
  • 参数

    | 选项 | 描述 | | - | - | | -h, --help | 获取帮助 | | -t, --template | 可自动创建的功能模版,比如生成编辑弹窗,template=modal | | -d, --dir | 组件放置的路径,请使用相对路径,默认在当前路径的./components目录内 | | -n, --name | 组件的名称,默认edit-modal | | --v2 | 调用该组件的vue文件路径,请使用相对路径 | | -m, --module | 引用的api和types模块名,比如商品模块,goods,会自动应用GoodsTypes和GoodsApi |

快速生成模块化文件

包括页面、路由文件、api 模块文件

  • 示例
nora vbcm -n store --cn 商品管理 -p list
  • 参数

    | 选项 | 描述 | | - | - | | -h, --help | 获取帮助 | | -n, --name | 模块名称(英文),如商品模块,store | | --cn | 模块名称(中文),如商品模块名称 商品管理 | | -p, --page-path | 页面放置的路径,绝对路径或直接名称,比如商品列表,list,最终会创建 ./views/store/list/index.vue 和 ./views/store/list/config.ts | | --cnp | 页面名称(中文),如商品列表,最终会在路由文件中使用,如果不传则默认使用模块名称,如商品管理 | | -s, --simple | 简单模式,仅生成页面文件和路由文件(或导入路由),不生成api模块文件 |