Bundle files into a single file using browserify.
var bundle = require( '@stdlib/tools/browserify/bundle' );Bundle files into a single file using browserify.
var files = [
'/foo/bar.js',
'/beep/boop.js'
];
bundle( files, clbk );
function clbk( error, bundle ) {
if ( error ) {
throw error;
}
console.log( bundle.toString() );
}To specify an output file path, provide a dest argument.
var files = [
'/foo/bar.js',
'/beep/boop.js'
];
bundle( files, './bundle.js', clbk );
function clbk( error ) {
if ( error ) {
throw error;
}
}var join = require( 'path' ).join;
var bundle = require( '@stdlib/tools/browserify/bundle' );
var fpath = join( __dirname, 'fixtures', 'index.js' );
var files = [ fpath ];
bundle( files, onBundle );
function onBundle( error, output ) {
if ( error ) {
throw error;
}
console.log( output.toString() );
}Usage: browserify-bundle [options] file1 file2 ...
Options:
-h, --help Print this message.
-V, --version Print the package version.$ browserify-bundle ./examples/fixtures/index.js