browserify-wrap

1.0.2 • Public • Published

browserify-wrap is a very simple browserify plugin to wrap your output bundle with a prefix and/or a suffix

Build Status Coverage Status Version License

API

const wrap = require('browserify-wrap');

var b = browserify();

b.plugin(wrap, {
  prefix : "[cool javascript prefix code here];"
});


b.plugin(wrap, {
  suffix : "[cool javascript suffix code here];"
});


b.bundle().pipe(somewhere);

wrap.concat(files [,sep])

As a common suffix might be to add some "raw" files, browserify-wrap provide a tiny helper for this (simple wrapper for map fs.readFileSync)

const wrap = require('browserify-wrap');
var suffix = wrap.concat(['file1.js', 'file2.js'], ';');
//suffix is now a concatenation of file1 & file2 (using ';' as separator)

Credits

Keywords / shout box

browserify, prefix, suffix, wrapper, plugin, browserify-plugin

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    1,972
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    1,972
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i browserify-wrap

Weekly Downloads

1,918

Version

1.0.2

License

ISC

Last publish

Collaborators

  • 131