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

@surveyking/my-ts-component

v1.0.0

Published

用于验证发布 ts 类型的组件

Readme

Irene Awesome Greeter

用于验证发布 ts 类型的组件

npm i -D typescript
# 添加 tsconfig.json 文件

# 一个好的包应该包括严格的代码规范,尤其是有其他协作者共同开发时。tslint-config-prettier 能防止 TSLint 和 Prettier 格式化规则的冲突。
npm i -D prettier tslint tslint-config-prettier

npm run lint
npm run format

# 白名单 在 package.json 中设置一个要发布的文件(夹)白名单 只有 lib 文件夹会出现在发布的包里(README.md 和 package.json 会被默认添加)
"files": ["lib/**/*"]

  • prepare:会在打包和发布包之前以及本地 npm install (不带任何参数)时运行
  • prepublishOnly:在 prepare script 之前运行,并且仅在 npm publish 运行。在这里,我们可以运行 npm run test & npm run lint 以确保我们不会发布错误的不规范的代码。
  • preversion:在发布新版本包之前运行,为了更加确保新版本包的代码规范,我们可以在此运行 npm run lint
  • version:在发布新版本包之后运行。如果您的包有关联远程 Git 仓库,像我们的情况一样,每次发布新版本时都会生成一个提交和一个新的版本标记,那么就可以在此添加规范代码的命令。又因为 version script 在 git commit 之前运行,所以还可以在此添加 git add
  • postversion:在发布新版本包之后运行,在 git commit之后运行,所以非常适合推送。