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

create-ts-npm

v0.1.0

Published

创建TypeScript NPM库的现代化模板

Readme

create-ts-npm

一个用于快速创建TypeScript NPM库的命令行工具,集成了现代化构建和测试工具链。

特性

  • 🚀 快速创建: 一行命令即可创建完整的TypeScript NPM库项目
  • 💪 TypeScript: 内置TypeScript支持与类型声明生成
  • 📦 多格式输出: 支持CommonJS、ES Module、UMD和IIFE格式
  • 🎨 CSS/SCSS支持: 可以将样式文件打包到JS中或提取为单独文件
  • 🧪 测试环境: 内置Node.js和浏览器测试环境
  • 🔄 灵活配置: 模块化且易于自定义的构建配置

快速开始

无需安装,直接运行:

# 使用npx(推荐)
npx create-ts-npm my-lib

# 或使用npm init
npm init ts-npm my-lib

# 或使用yarn create
yarn create ts-npm my-lib

然后按照提示操作,输入包名称、描述和作者信息。

手动安装

如果你需要多次使用,也可以选择全局安装:

# 全局安装
npm install -g create-ts-npm

# 然后使用
create-ts-npm my-lib

生成的项目内容

生成的项目包含以下内容:

.
├── src/               # 源代码目录
│   ├── index.ts       # 主入口文件
│   └── styles/        # 样式文件
├── build/             # 构建配置
├── dist/              # 打包输出目录(构建后生成)
├── types/             # 类型声明文件(构建后生成)
├── test-project/      # 测试项目
├── tsconfig.json      # TypeScript配置
└── rollup.config.js   # Rollup配置

使用生成的项目

生成项目后,你可以:

# 安装依赖
cd my-lib
npm install

# 开发模式(构建并在Node.js中测试)
npm run dev

# 在浏览器中测试
npm run test:browser

# 构建生产版本
npm run build:pro

# 发布到NPM
npm run toPublish

许可证

MIT