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

demo-day

v1.0.0

Published

1.NPM是什么,为什么要使用NPM? npm是一个命令行程序,它是通过在终端中,运行npm子命令来管理项目中所依赖的Node包

Readme

1.NPM是什么,为什么要使用NPM? npm是一个命令行程序,它是通过在终端中,运行npm子命令来管理项目中所依赖的Node包

2.什么是CommonJS规范,CommonJS规范的几个要求? 在js中,我们把代码写到一个文件里,然后通过 网页标签来引入到页面中,然后加载,从而控制页面的交互,这个js就叫脚本,它只是一个小功能或者是程序,如果我们想要开发一个大型应用系统,避免多人开发同一个功能,代码拆分结构各有不同,为了方便后续接手,规范的提出,就是需要大家一起去遵循,同一规范下开发的代码,更方便维护

CommonJsj是Node社区提供的代码的拆分规范,针对Node服务端开发提供的一套代码拆分和引用规范

  1. 一个js文件就是一个模块,模块内的功能,数据,必须导出,其他模块在导出才能使用
  2. 模块与模块之间只能通过导入导出来实现复用,相互独立
  3. 使用 module.exportsexports导出模块内部的变量和方法,供其他模块导入使用
  4. 使用require导入其他模块导出的变量和方法

3.如何发布一个Node包,发布Node包需要注意那几点?

1.创建一个普通目录 2.使用npm init -y 生成package.json 文件 3.在项目根目录下创建一个入口文件 4.在根目录下开发自己要提供的功能, 5. 在终端使用 npm login登录,然后进入要发布的Node根目录下使用 npm publish上传Node包

注意事项 1.注册账号时,邮箱必须效验,才能上传Node包 2.Node包名不能是很普通的名字,因为Node仓库要求包名唯一,如果名字已存在,会上传失败

4.什么是registry? 如何切换registry,为什么要切换registry?

全局安装 nrm

npm i nrm -g

安装完成后,使用 nrm ls 查询所有的 registry

nrm ls

使用 (切换) 某个 registry

nrm use taobao