Easy and lightweight tool to quickly bundle JavaScript (and CSS and other assets) releases.

npm install bundy
12 downloads in the last month


Easy and lightweight tool to quickly bundle JavaScript (and CSS and other assets) releases.

If you are working on a JavaScript library, plugin or a widget and want to quickly "bundle" it (minify all JavaScript and CSS files, put them in single files, copy other assets, eg. images and fonts, to release directory), then Bundy is for you.



$ cd [your working dir]
$ npm install bundy

Create Bundy build file

Create bundy.js file in which you will describe the build process. It should at least contain the following:

var bundy = require('bundy');

// your build process here

bundy.build(); // this always needs to be at the end of the file

The last line will tell Bundy to start processing what you told it do to.

Describing your build process

Bundy can do 3 tasks:

Minify JavaScript

], 'minified/myplugin.min.js');

This will concatenate and minify the four given files and save the result in minified/myplugin.min.js.

Google Closure Compiler Java application is used to minify the JavaScript, therefore you need JVE installed and enabled.

Minify CSS

bundy.css('src/myplugin.css', 'minified/myplugin.min.css');

This will minify the given CSS file and save it in minified/myplugin.min.css.

YUI is used to minify the CSS and JVE is required to be able to use it.

bundy.css(), just like bundy.js() can also accept array of files as 1st argument, in which case the files will be concatenated and minified.

Copy files

], 'minified/img/');

This will copy the given four files into minified/img/ directory keeping the original file names.

You can also copy a single file and change its' name:

bundy.copy('src/img/some_image.png', 'minified/img/the_image.png');

Or you can copy a single file and ommit its' file name in destination, in which case the original file name will be kept:

bundy.copy('src/img/another_image.png', 'minified/img/');

Running Bundy

Once installed and created bundy.js simply run it:

$ node bundy.js


Example bundy.js file:

var bundy = require('./lib/bundy');

], 'minified/acme.min.js');

bundy.copy('src/acme.config.js', 'minified/acme.config.js');

], 'minified/acme.min.css');

], 'try/minified/img/');



Why another builder/minifier for JavaScript? There's Grunt and a lot of other tools for that, but I just wanted something small and simple to quickly package mainly browser-based JavaScript plugins.


Bundy is using the following:

npm loves you