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

jsinclude

v1.3.1

Published

Load js and css files programatically in the browser at run-time.

Readme

jsinclude

Programmatically include JavaScript and CSS files in the browser at runtime.

example

<html>
 <head>
  <script src="/path/to/include.js"></script>
  <script>
   include.once("/js/jquery.js", function () {
    console.log('jquery is loaded');
   });

   include.css("/css/jquery-ui.css");

   include(function () {
    console.log('all includes are loaded');
   });
  </script>
 </head>
 <body>
  Hello
 </body>
</html>

api

include(path [, charset] [, callback])

Load a script referenced by path and call the optional callback function when it has been loaded. If a string valued charset is passed as the second argument, then the charset attribute will be set on the script element.

include(callback)

Call callback once all pending include files have been loaded.

include.once(path [,charset] [, callback])

Load a script referenced by path at most one time and call the optional callback function when it has been loaded. If a string valued charset is passed as the second argument, then the charset attribute will be set on the script element.

Callback is still called if the script has already been loaded one or more times.

  • path : (required) path to the javascript file to load
  • callback : (optional) callback function which is called once the script referenced by path has been loaded.

include.css(path [, options])

Load a stylesheet referenced by path.

  • path : (required) path the css file to load
  • options : (optional)
    • prepend : insert the css file before all other stylesheets

include.pathAppend

pathAppend is a configuration option that is appended to each path.

If pathAppend is a function, it is called with path as its only argument. The return value should be a string to append to path.

Example using a string value:

var package = require('./package.json');

include.pathAppend = 'v=' + package.version;

Example using a function:

var package = require('./package.json');

include.pathAppend = function (path) {
	if (~path.indexOf('mydomain.com')) {
		return 'v=' + package.version;
	}
	else return '';
};

License

MIT