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 🙏

© 2025 – Pkg Stats / Ryan Hefner

xiejiabing

v1.0.0

Published

如果你自己的模块依赖于某个包,并通过 Node.js 的 require 加载,那么你应该选择本地安装,这种方式也是 npm install 命令的默认行为。 命令执行之后将会在当前的目录下创建一个 node_modules 的目录(如果不存在的话),然后将下载的包保存到这个目录下。 # package.json The best way to manage locally installed npm packages is to create a package.json file. two

Readme

npm install

如果你自己的模块依赖于某个包,并通过 Node.js 的 require 加载,那么你应该选择本地安装,这种方式也是 npm install 命令的默认行为。 命令执行之后将会在当前的目录下创建一个 node_modules 的目录(如果不存在的话),然后将下载的包保存到这个目录下。

package.json

The best way to manage locally installed npm packages is to create a package.json file. two ways to create package.json a.Run a CLI questionnaire. Code: npm init b.created a default package.json. Code: npm init -y This method will generate a default package.json using information extracted from the current directory. 所以如果原本有node_modules那么package.json会增加很多内容

ists the packages that your project depends on.

allows you to specify the versions of a package that your project can use using semantic versioning rules.

makes your build reproducible, and therefore much easier to share with other developers.

Specifying Dependencies

"dependencies": These packages are required by your application in production.

"devDependencies": These packages are only needed for development and testing.

npm update

升级所有的包

npm uninstall

卸载包

global & locally

There are two ways to install npm packages: locally or globally. Choose which kind of installation to use based on how you want to use the package.

global

If you want to use a package as a command line tool, then install it globally. This way, it works no matter which directory is current. This is the choice you would use if you were installing grunt, for example.

locally

If you want to depend on the package from your own module, then install it locally. This is the choice you would use if you are using require statements, for example.