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

leslie-pkg1

v1.0.2

Published

This a demo for create and publish our own npm package

Readme

创建包

//在初始化话时我们定义了module的入口文件是index.js
//在初始化的时候输入的package的名字就是后面npm install时的名字,后面也可以再package.json里面修改
npm init

在index.js中定义需要export出来的函数

发布包

新用户,先去npm的网站注册

//输入注册npm时的账号密码以及邮箱
npm adduser

//查看信息
npm config ls

//发布
npm publish

使用

需要使用这个package的时候

npm install pkg-name --save(--save-dev)

更新新的包

修改的原有的包的代码之后不可以直接publish的已有的仓库和版本当中,会提示我们没有权限复写已经publish的包 这时候需要修改package.json里面包的版本号

在已经依赖于这个的包的用户这边

npm update

可以将使用的包更新的最新

删除已经publish的包

npm unpublish [<@scope>/]<pkg>[@<version>]

在git上维护自己的包

新建一个主分支和一个开发分支 每一部分开发完成开一个版本分支,将版本的分支publish到npm上面

在develop分支上进行开发,开发完成切换到对应的版本的备选分支,review备选分支的代码,没有问题的话merge的备选分支里面 修改package.json里面的版本号,上传到git以及发布到npm 切回到develop分支进行新的开发