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 🙏

© 2024 – Pkg Stats / Ryan Hefner

packd

v2.8.0

Published

Simple alternative to browserify-cdn

Downloads

19

Readme

packd

Rollup as a service (with a little help from Browserify).

This is a simple app for generating UMD bundles of npm packages, similar to browserify-cdn aka wzrd.in. I made it because wzrd.in sometimes goes offline, and I need its functionality for the Svelte REPL. Unfortunately I couldn't get browserify-cdn to run on now.sh, so I decided to roll my own.

And since I was rolling my own, it made sense to use Rollup. (Feel free to roll your eyes.) For npm packages that expose pkg.module, such as the D3 modules, this means you get smaller, more efficient bundles than with browserify-cdn. packd also gzips the files it serves, typically resulting in much smaller requests.

Since Rollup can't handle all of the CommonJS code on npm, packd will use Browserify (or a combination of Rollup and Browserify) where appropriate.

Using packd

You can try a hosted version of packd at https://bundle.run.

Bundles can be accessed like so. Bear in mind that if a bundle isn't cached, it needs to be installed and built before it can be served, which may take a little while:

/[name]

You can specify a tag (e.g. 'latest') or a version (e.g. '1.2.3'):

/[name]@latest

If you're using these URLs with <script> tags, you may need to specify the module's name (i.e. the global variable name used to access it, corresponding to moduleName in Rollup and standalone in Browserify). packd will guess based on the module ID, but you may need to control it with the name query:

/underscore?name=_

Hosting an instance

packd is a straightforward Express app — clone this repo, npm install (or yarn install), then npm start. To host on now, simply npm install -g now and run now.

Is this like unpkg.com?

No. unpkg.com is like a CDN for npm — it serves the actual files in npm packages. In a lot of cases that's perfect, but since some library authors don't include distributable bundles (tsk, tsk) it's not a general solution to the problem that packd addresses. Moreover, many npm package authors don't minify their code, whereas packd does.

It is, however, blazing fast and extremely reliable. If a distributable version of a dependency is on unpkg, you should always prefer that.

Credits

Thanks to James Halliday and Joshua Holbrook for their work on Browserify and browserify-cdn, and Zeit for making such an easy to use hosting environment.

License

MIT