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

@hjfc/pack-template

v0.0.8

Published

typescript lib common template

Downloads

2

Readme

TypeScript 库基础模板

使用方式

  1. clone或者下载本模版的压缩包,如果是clone的,请删除.git文件夹
  2. 包管理器为yarn v4,请确保corepack已经开启
  3. 运行yarn安装依赖
  4. src目录开发代码

代码提交

此模版配置了husky来运行提交前所必须的校验以及commitlint对提交信息进行规范性检测,因此你需要确认:

  • husky被正确初始化,如果没有请执行npx husky init
  • package.json中的lint-staged字段被按需设置
  • 修改changelog.config.js,设置你自己的scopes

提交代码时使用yarn commit,不要直接使用git commit

构建

此模版使用了rollup来构建ES6代码,并使用了一系列插件来组织构建过程

此模版内置了两种构建配置

  1. rollup.config.ts 打包输出为单文件构建方式,运行命令yarn build
  2. rollup.preserve.ts 按照源文件目录输出构建,运行命令yarn build:preserve

发布

此模版使用了release-it用于管理包版本、生成release、发布到npm等

使用yarn release:xx:xxx(具体见package.json)执行发布过程,更多关于包版本的信息可以运行npm help version或查看此文章

请根据自身情况配置release-itrelease-it默认不发布包,你可以执行yarn pub执行默认发布或者yarn run:publish执行带tag的发布

文档

此模版内置了vitepress静态站点生成器,并且基于使用github workflow编写了发布到github pages的配置脚本 你也可以查看部署选择合适的方式完成文档部署

tips: 如果使用github pages请按照此文章设置ACCESS_TOKEN

单元测试

此模版内置了最基础的基于vitest测试框架,根据不同测试需要需要进行额外的配置,yarn test测试用例