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

npmjs-package

v1.1.5

Published

一个npm包测试

Downloads

17

Readme

发包步骤

  1. 使用 npm init 初始化一个项目
  2. 使用 npm adduser 添加用户信息(第一次发包是需要执行该步骤,后续则不需要)填写邮箱后会收到验证码,收到后继续输入验证码即可。 npm-adduser
  3. 使用 npm login 登录 npmjs (如果执行了第二步,则此步骤无需执行)
  4. 使用 npm publish 将本地包发送到 npmjs 服务端 npm-publish
  5. 使用 npm search <包名> 可检索是否已经发送成功 npm-search

缩小npm包体积

外部扩展(Externals)

https://webpack.docschina.org/configuration/externals/

白名单模式

只有 dist、src 目录会被包含在 npm 包中。 package.json

{
  "files": [
    "dist",
    "src"
  ],
}

移除未使用的 lodash 功能

npm install lodash-webpack-plugin --save-dev

webpack.config.js 查看

https://www.npmjs.com/package/lodash-webpack-plugin

const LodashModuleReplacementPlugin = require('lodash-webpack-plugin');

pkgfiles

pkgfiles 查看 npm publish 包含哪些文件

  1. 安装依赖
"dependencies": {
    "pkgfiles": "^2.3.2"
}
  1. 执行 npx pkgfiles 命令
PATH                                     SIZE     %   
src\utils\index.js                       85 B     2%  
src\main.js                              98 B     2%  
src\plugins\index.js                     128 B    3%  
src\utils\util.auth.js                   414 B    9%  
package.json                             494 B    10% 
src\plugins\vue-access-control\index.js  505 B    10% 
README.md                                799 B    17%
dist\mcsdk.js                            1.14 kB  24%
dist\plugins.js                          1.15 kB  24%

DIR                                      SIZE     %
src\utils/                               499 B    10%
src\plugins\vue-access-control/          505 B    10%
src\plugins/                             633 B    13%
src/                                     1.23 kB  26%
dist/                                    2.29 kB  48%
.                                        4.81 kB  100%

PKGFILES SUMMARY
Size on Disk with Dependencies  ~166 MB
Size with Dependencies          ~127 MB
Publishable Size                ~4.81 kB
Number of Directories           6
Number of Files                 9