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

requirejc

v2.3.1

Published

auto require utils

Readme

RequireJC

Build Status Software License

一个非常宽松的依赖加载插件,本身也不依赖任何其它框架。对加载的JS没有特别的要求,只是直接地动态加载到网页中。非常适合做后台一类的项目,这些项目一般都会使用大量的外部jquery插件,而无需在首页一次性加载进来而是可以按需加载JS和CSS.

安装

1.安装或下载:https://github.com/hezhiying/requirejc.git

bower install hezhiying/requirejc

2.引入requirejc.js

<script type="text/javascript" src="/bower_components/requirejc/requirejc.js"></script>

使用

//全局配制
RequireJC.config({
    ver:'v0.0.1',//版本号会自动加在网址后面
    baseUrl:'/',
    debug  : false,
    paths:{
    	js1:'js1.js',
    	js2:['js2.js', 'js4', 'js5.js'], //v2.3.0支持数组格式
    	js4:'js4.js'
    },
    //js对应的依赖关系
    dep:{
    	js1:['js2','js1.css']
    },
    //全局映射所有依赖加载前先加载的插件
    map:['js4']
    
});

//获取配制
let config = RequireJC.config();

//使用
RequireJC('js1',function(){
	console.log('加载成功');
})
RequireJC(['js1','http://localhost/xxx.css'],function(){
	console.log('加载成功');
})

//其它方法
RequireJC.ver(ver);//设置或读取版本号
RequireJC.debug(debug);//设置或读取debug状态
RequireJC.addPath(name,path,dep);
RequireJC.toUrl(name); //获取实际加载的URL

Features

  • 支持JS和CSS.
  • 支持相互依赖.
  • 对加载的JS和CSS文件没有特别要求,宽松的加载(和html中script方式加载一样).
  • 支持全局优先加载,所有插件加载前优先加载.
  • 支持调试模式,调试模式下加载时不会有缓存.

构建

npm install
npm run dev  //生成requirejc.js
npm run prod //生成requirejc.min.js
#本地调试
npm run hot 

1.0分支使用gulp构建:1.0-gulp

预览

http://localhost:8080/demo/

在chrome调试面板中可以直接调试

更新日志

[v2.3.0]

  • paths字段支持数组格式
  • 加载超时抛出异常更改为警告,以让程序可以继续执行加载剩余文件
  • 加载超时由10秒改为5秒

[v2.2.3]

  • 修复同时多次加载同一脚本时问题