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

myfirst_sue1016

v1.0.3

Published

how i learned npm

Readme

README

how i learned npm

基础操作


简介

npm是nodejs的一个模块。
通过这个模块,
我们可以从npm的网站上面
下载js模块,
上传js模块。
从npm网站上下载下来的js模块可以直接应用到我们的项目之中。
大大提高我们的工作效率。

首先要正确安装nodejs。
假定已经安装。


安装包

eg:

  npm i jquery   
  在当前目录下局部安装jquery  


  npm i jquery -g
  全局安装jquery  

卸载包

在所在目录下

 npm uninstall jquery   

卸载当前目录下的jquery


生成配置文件

一次性想从npm网站上下载多个模块
可以一条一条输入
也可写在相应的配置文件里 g

 npm init  

使用配置文件

eg:

  npm i lodash  

然后查看配置文件

如果想下载指定版本

  npm i [email protected]    

再次查看配置文件
版本已变

如果只有一个配置文件,但是还没有下载模块,只需要在有配置文件的目录里,

  npm i   

就会自动下载配置文件里的模块

比如你可以试试删除刚刚下载的模块
这个时候配置文件里仍有刚刚删除的模块,

  npm i  

又会重新下载该模块


更新模块

直接在相应目录里

 npm update
   

自动更新到最新版本


全局包

本地包会把包放在项目目录里
全局包会把包放在nodejs所安装的目录里

如果项目需要相应的模块,就把它本地安装
如果你需要在终端使用包的相关命令,就把它全局安装

如何安装/卸载全局包

   npm install typescript -g  
   npm uninstall typescript -g 

npm查看全局安装过的包




开发模块


发布包

在项目目录里

 npm adduser  

输入npm的网站(需要注册)的账号密码

登录成功后输入

  npm publish   
  

注意包名不能跟别人的重复

使用 cnpm 的注意报错

  no_perms Private mode enable, only admin can publish this module
  设置回原本的就可以了:
  npm config set registry http://registry.npmjs.org 

发布新版本

需要在配置文件中更改版本后才能重新发布

   npm publish  

否则会报错


撤销包

  npm unpublish   



编写说明文档

就是在项目工程里编写README
跳过



过滤文件

在配置文件里加入files属性来决定要发布的内容。