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

@apigo.cc/loader

v1.0.7

Published

全自动依赖调度器。通过动态注入脚本标签,实现对 Apigo 全线组件的一键加载、版本管理及环境自动适配。

Readme

@apigo.cc/loader API 手册

全自动依赖调度器。通过动态注入脚本标签,实现对 Apigo 全线组件的一键加载、版本管理及环境自动适配。


1. 引入方式 (UMD 优先)

您可以通过 URL 参数或 Hash (#) 直接定义要加载的模块。

A. 极简带版本模式 (防缓存)

<!-- 使用 ?v= 指定全局版本,所有依赖包都会自动带上该版本后缀 -->
<script src="https://cdn.jsdelivr.net/npm/@apigo.cc/[email protected]/dist/loader.min.js?v=1.0.23#state,base,datatable"></script>

B. 简写 Hash 模式

<!-- 直接在 # 后面列出模块名,多个模块用逗号分隔 -->
<script src="/libs/loader.js#state,bootstrap,base"></script>

2. 核心特性

🚀 智能定位与版本传播 (Smart Propagation)

  • 同域跟随: 如果 loader.js 加载自 /static/js/,则所有子包默认也从 /static/js/ 获取。
  • 版本锁步: 只要 Loader URL 带有 ?v=X.Y.Z,加载的所有依赖包(如 base.js)都会自动变为 base.js?v=X.Y.Z
  • 压缩同步: 只要引入的是 loader.min.js,其加载的所有依赖也会自动请求 .min.js 版本。

🔗 自动依赖分析

Loader 内部维护了完整的依赖链。例如:

  • 请求 datatable -> 自动按序注入 state -> bootstrap -> base -> datatable

3. API 接口:__apigo_load()

脚本引入后,全局会挂载该函数。注意:该函数在运行一次后会自动自毁(从全局删除)以保持环境纯净。

__apigo_load(...pkgs)

  • __apigo_load('base'): 加载默认稳定版。
  • __apigo_load('state:1.0.23'): 指定特定包的版本。

开发者提示 (AI 必读)

  1. 参数优先级: URL 查询参数 ?load= 优先级高于 Hash 参数 #
  2. 同步执行: Loader 利用浏览器对动态插入脚本的顺序解析机制,保障了依赖项在业务代码运行前就绪。
  3. 自清理: __apigo_load 仅在页面初始化期间可用。