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

kg_utils

v1.1.1

Published

常用工具包

Downloads

2

Readme

1. 生成模板文件

kg g <TemplateName> <TargetName> [options...] -s src/pages --default | 参数 | | 描述 | | ---- | ---- | ----| |TemplateName | 必填 | 模板文件/文件夹名称,.templates的子文件全称或子文件夹名称 | | TargetName | 必填 | 需要生成的文件/文件夹名称 | | -s | 可选 | 生成文件位置,src默认为src/pages| | --default | 可选 | 不写的话默认使用用户本地的.templates文件夹下的配置,加上--default,会从包里面找。 | | [options...] | 可选 | 用户自定义变量,同umi生成器,模板文件中使用{{{customVariable}}}字符串时,命令行中使用--customVariable test,就会将文件中所有{{{customVariable}}}替换为test,并且文件中的{{{name}}}会自动替换为TargetName |

例如:kg g AntdTableCURD UserManage -s src/pages/System -count1

2. 根据指定文字裁剪字体库文件

  • [ ] 转换格式ttf,woff等格式转换

kg fontcut <TargetFilePath> --config --include 中文|英文|中文英文 | 参数 | | 描述 | | ---- | ---- | ----| | TargetFilePath | 必填 | 字体库路径,例如public/fonts/xxx.ttf | | --config | 可选 | 使用--config,默认从项目根目录下读取fontcut.txt中的内容,且--include会失效 | | --include | 可选 | 预设中文/英文/中文英文 |

生成在TargetFilePath同级目录下,新文件前缀为subset-xxx.ttf

3. 压缩图片文件夹

  • [ ] 待优化

kg imagemin <TargetFilePath>

4. swagger接口文档生成typescript service

  • [ ] 待优化

kg swagger -u http://xxx/auth-server/v2/api-docs --proxy /api --output ./src/services --reserve false --templatePath .swaggerTemplate | 参数 | | 描述 | | ---- | ---- | ----| | -u/--url | 必填 | swagger地址 | | -p/--proxy | 可选 | proxy前缀,默认/api | | -o/--output | 可选 | 输出文件地址,默认.src/services | | -r/--reserve | 可选 | 当使用默认模板时,会在包的根目录下自动生成一个模板,该选项表示是否移除自动生成的模板,默认值为false | | -t/--template | 可选 | 用户本地模板文件地址,可通过kg swagger-template指令来生成模板文件,默认放在.swaggerTemplate文件夹中 | swagger template 使用eta语法:https://eta.js.org/docs/

5. rap2接口文档生成typescript service

  • [ ] 待实现