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

chu_demo

v1.0.1

Published

``` npm install ```

Readme

Project setup

npm install

Compiles and hot-reloads for development

npm run serve
or
make local

Compiles and minifies for production

npm run build
or make build

Staging package

npm run test-build
or make test

发布前的准备

  1. 注册一个npm账号 前往NPM官网进行注册

  2. 创建一个简单的包 在本地创建一个项目文件夹sugars_demo (名字自己取,不要和NPM上已有的包名重复冲突就好) 然后通过终端进入文件夹(路径每个人不一样)

cd sugars_demo 接着可以通过命令创建一个包信息管理文件package.json

npm init 一路回车或根据包的内容来填写相关信息后,package.json内容大概如下

{ "name": "sugars_demo", "version": "1.0.0", "description": "A demo", "main": "index.js", "scripts": { "test": "echo "Error: no test specified" && exit 1" }, "repository": { "type": "git", "url": "" }, "keywords": [ "sugars", "demo" ], "author": { "name": "sugars", "email": "[email protected]" }, "license": "MIT" } 接着在sugars_demo文件夹里创建一个index.js文件,然后简单敲几行代码

;(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.moduleName = factory() }(this, (function () { var test = { sayHi: function () { console.log('hi'); } };

return test }))) 到这里一个简单的包就创建好了。 如果想再完善一下的话,还可以在包根目录下创建README.md文件,里面可以写一些关于包的介绍信息,最后发布后会展示在NPM官网上。

开始发布创建好的包 使用终端命令行 如果是第一次发布包,执行以下命令,然后输入前面注册好的NPM账号,密码和邮箱,将提示创建成功

npm adduser 如果不是第一次发布包,执行以下命令进行登录,同样输入NPM账号,密码和邮箱

npm login 注意:npm adduser成功的时候默认你已经登陆了,所以不需要再进行npm login了

接着先进入项目文件夹下,然后输入以下命令进行发布

npm publish

当终端显示如下面的信息时,就代表版本号为1.0.0的包发布成功啦!前往NPM官网就可以查到你的包了

myMacBook-Pro:sugars_demo sugars$ npm publish

npm ERR publish 403

You do not have permission to publish 'bootstrap'.Are you logged in as the corrent user?:bootstrap 意思就是你没有权限发布名为“bootstrap”的包,显然这个鼎鼎有名的包已经有人发布了,所以你只能另取它名。

更新已经发布的包 更新包的操作和发布包的操作其实是一样的

npm publish

但要注意的是,每次更新时,必须修改版本号后才能更新,比如将1.0.0修改为1.0.1后就能进行更新发布了。 这里的包版本号有一套规则,采用的是semver(语义化版本),通俗点意思就是版本号:大改.中改.小改