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

woller-mode

v1.0.0

Published

test

Readme

webpack

  • 理解前端模块化
  • 理解webpack打包的核心思路
  • 理解webpack中的“关键人物”

模块化

  • 优点

    • 作用域封装
    • 重用性
    • 解除耦合
  • 进化史

    • //AMD(异步模块定义)
      define('getSum',['math'],function(math){
        return function(a,b){
          console.log('sum'+ math.sum(a+b))
        }
      })
    • //common.js
      const math = require('./math')
      exports.getSum=function(a,b){
        return a+b;
      }
    • //ES6 MODULE
      import math from './math'
      export function sum(a,b){
        return a+b;
      }

webpack的打包过程

  • 从入口文件开始,分析整个应用的依赖树
  • 将每个依赖模块包装起来,放到一个数组中等待调用
  • 实现模块加载的方法,并把它放到模块执行的环境中,确保模块之间可以相互调用
  • 把执行入口文件的逻辑放在一个函数表达式中,并执行这个函数

npm与包管理器

  {
    "name": "webpack",//包名称
    "version": "1.0.0",//版本号
    "description": "test",
    "main": "index.js",//执行入口
    "scripts": {
      // preinstall postinstall prepublish postpublish
      "test": "echo \"Error: no test specified\" && exit 1"
    },//自定义脚本
    "author": "",
    "license": "ISC",
    "dependencies": {//生产环境依赖 npm install --only=prod
      "loadash": "^1.0.0"
    },
    "devDependencies": {//开发环境依赖 npm install --only=dev
      "jquery": "^3.5.1"
    }
  }
  • ^version: 中版本和小版本 ^1.0.1-->1.x.x
  • ~version: 小版本 ~1.0.1-->1.0.x
  • version: 特定版本