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

yuejingge-utils

v1.0.4

Published

参考:

Readme

参考:

https://zhuanlan.zhihu.com/p/525657629

https://www.npmjs.com/package/ife-utils

https://www.ifrontend.net/2022/06/rollup-ife-utils/

https://www.jianshu.com/p/0faaff26a2c8

Rollup 是一个 JavaScript 模块打包工具

https://www.rollupjs.com/

  • 自动 Tree-shaking
  • 打包速度快
  • 配置简单
  • 更适合构建javascript库

typedoc 生成库文档

https://typedoc.org/

npm install typedoc -D

文档打开地址:http://localhost:3000/docs/modules.html

jest 用于代码单元测试

https://jestjs.io/

bundle 格式

  • system SystemJS 加载器格式
  • amd 异步模块定义,用于像 RequireJS 这样的模块加载器
  • umd 通用模块定义,以amd,cjs 和 iife 为一体
  • cjs CommonJS,适用于 Node 和 Browserify/Webpack
  • esm 将软件包保存为 ES 模块文件,在现代浏览器中可以通过 标签引入

支持es6

npm install --save-dev rollup-plugin-babel

rollup 的模块机制是 ES6 Modules,但并不会对 es6 其他的语法进行编译。

因此如果要使用 es6 的语法进行开发,还需要使用 babel 来帮助我们将代码编译成 es5

兼容 commonjs

npm install --save-dev rollup-plugin-commonjs rollup-plugin-node-resolve

替代环境变量

npm install --save-dev rollup-plugin-replace