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

npm-init2

v3.0.15

Published

a lazy npm init for create new package, support yarn workspace. make we without use `mkdir xxx && cd xxx && [npm|yarn] init` with `npx npm-init2 xxx`

Readme

npm-init2

懶人版的 npm init,支援 Yarn Workspaces / A lazy npm init that supports Yarn Workspaces

簡介 / Introduction

npm-init2 簡化了創建新 Node.js 套件的流程,讓您無需執行 mkdir xxx && cd xxx && npm init,只需執行 npx npm-init2 xxx 即可。

npm-init2 simplifies the process of creating new Node.js packages, allowing you to run npx npm-init2 xxx instead of mkdir xxx && cd xxx && npm init.

安裝與使用 / Installation & Usage

# 快速初始化新套件 / Quickly initialize a new package
npx npm-init2 my-package

# 使用 Yarn / Use with Yarn
npx npm-init2 my-package --npmClient yarn

# 在現有目錄初始化 / Initialize in existing directory
npx npm-init2 --cwd ./my-project

命令列選項 / CLI Options

| 選項 / Option | 說明 / Description | |--------------|-------------------| | --npmClient | 指定套件管理器 (yarn, npm, pnpm) / Specify package manager | | --cwd | 設定工作目錄 / Set working directory | | --name | 指定套件名稱 / Specify package name | | --skipCheckWorkspace | 跳過 Workspaces 檢查 / Skip workspace detection | | --sort | 對 package.json 進行排序 / Sort package.json | | --yes / -y | 使用預設值 / Use default values | | --tsdx | 啟用 TSDX 設定 / Enable TSDX configuration | | --private / -p | 設定為私有套件 / Set as private package |

功能特性 / Features

  • 一鍵初始化 - 簡化 mkdir && cd && npm init 流程
  • 🏢 Workspaces 支援 - 自動偵測並整合 Monorepo 環境
  • 📝 智能設定 - 自動填充 repository、bugs、homepage 等欄位
  • 🔧 腳本範本 - 提供常見的 npm scripts 預設值
  • 📦 依賴管理 - 自動添加 tslib 等常用依賴
  • 🧪 Jest 整合 - 偵測到 Jest 時自動設定測試腳本
  • 📚 README 生成 - 自動生成基礎 README.md

使用範例 / Examples

基本使用 / Basic Usage

# 創建新套件 / Create new package
npx npm-init2 my-awesome-lib

# 使用預設值快速創建 / Quick create with defaults
npx npm-init2 my-lib -y

Workspaces 環境 / In Workspaces Environment

# 在 Monorepo 中創建新套件 / Create package in monorepo
cd my-monorepo
npx npm-init2 packages/my-new-package

# 自動偵測 Workspaces 前綴 / Auto-detect workspace prefix
npx npm-init2 my-package --skipCheckWorkspace

TypeScript + TSDX 專案 / TypeScript + TSDX Project

# 創建 TSDX 專案 / Create TSDX project
npx npm-init2 my-ts-lib --tsdx

對應指令 / Command Mapping

| npm-init2 指令 | 等效指令 | |---------------|---------| | npx npm-init2 | npm init | | npx npm-init2 --npmClient yarn | yarn init | | npx npm-init2 my-pkg | mkdir my-pkg && cd my-pkg && npm init |

預設腳本 / Default Scripts

初始化後的 package.json 會包含以下腳本:

The initialized package.json will include these scripts:

{
  "scripts": {
    "test": "echo \"Error: no test specified\"",
    "preversion": "echo preversion",
    "prepublishOnly": "yarn run preversion"
  }
}

相關專案 / Related Projects

授權 / License

ISC