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-silly

v6.1.1

Published

first npm demo

Readme

Npm

版本号语义化理解

major.minor.patch[-prerelease]

主版本号-次版本号-修复版本号[-测试版本号/标签]

版本号结构

通常由四部分组成,例如(1.2.3-beta.1)

  • maior表示主版本号,新增功能,不向下兼容
  • minor表示次版本号,新增功能,向下兼容
  • patch表示修复/补丁版本号,修复某些BUG
  • prerelease表示测试版本号,不稳定
    • alpha:内测版标签,很多BUG
    • beta:尚有BUG版标签
    • rc:正式版前的最后一个候选测试版标签

dist-tag标签:

默认情况下,npm publish时使用latest标记,若要使用其他标签,可通过—-tag标记

发布带标签的版本:npm publish —tag <标签>

把标签标记到指定包版本:npm dist-tag add <包名>@<版本号> [<标签>]

示例;

npm publish --tag beta

npm dist-tag add 包名@3.0.0 beta

在版本迭代时,标签只能指向一个版本号,且:

latest标签永远指向最新的稳定版本;

beta标签永远指向最新的公测版本

安装命令

| 命令 | 说明 | | --- | --- | | npm install react npm install react@lastly | 安装最新版 | | npm install [email protected] | 安装指定版本 | | npm dist-tag ls | 查看标签 |

版本升级工具npm version:自动修改package.json中的版本号,并且自动git commit

升级主版本号:npm version major

升级次版本号:npm version minor

升级补丁修复版本号:npm version patch

升级测试版本号: npm version prerelease

发布包:npm publish


流程:

  1. 新建一个空文件夹
  2. 生成package.json配置信息
  3. 写包要实现的功能
  4. 登陆npm
  5. 发布

package.json文件

必填项:name、version

{
  "name": "npm-silly",
  "version": "4.0.0",
  "description": "first npm demo",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "silly",
  "license": "ISC"
}

文件目录管理:

所有包都需要一个 index.js文件。这是包的入口文件

模拟操作:

  • 新建包
mkdir npm-demo
cd npm-demo
touch indedx.js

npm init 
npm login
  • git管理
git init
git remote add origin xxx
  • 发布包
npm publish
  • 升级主版本
npm version major
  • 升级次版本
npm version minor
  • 升级补丁修复版
npm version patch
  • 升级测试版本号
npm version prerelease
  • 升级版本号时打标签
npm publish --tag beta
  • 给特定版本号打标签
npm dist-tag add 包名@3.0.0 beta
  • 查看当前包的版本和标签
npm dist-tag ls
  • 取消/撤销某版本号

npm-silly