by Rich-Harris

Rich-Harris / packd

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

224 Stars 25 Forks Last release: about 1 year ago (2.7.3) MIT License 169 Commits 25 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:


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 I made it because sometimes goes offline, and I need its functionality for the Svelte REPL. Unfortunately I couldn't get browserify-cdn to run on, 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

, 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

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:


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


If you're using these URLs with

 tags, you may need to specify the module's name (i.e. the global variable name used to access it, corresponding to 
in Rollup and
in Browserify). packd will guess based on the module ID, but you may need to control it with the

By default, Packd will generate a UMD bundle. In some cases, you can generate an ES module bundle instead, by appending

. This only works if the requested package, and all its dependents, are themselves distributed as ES modules.

Hosting an instance

packd is a straightforward Express app — clone this repo,

npm install
yarn install
), then
npm start
. To host on now, simply
npm install -g now
and run

Is this like

No. 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.


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.



We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.