bul

bulkify

transform inline bulk-require calls into statically resolvable require maps

Showing:

Popularity

Downloads/wk

3.6K

GitHub Stars

106

Maintenance

Last Commit

5yrs ago

Contributors

1

Package

Dependencies

4

Size (min+gzip)

91.4KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

bulkify

transform inline bulk-require calls into statically resolvable require maps

build status

The bulkify function signature is compatible with browserify's transform API.

example

var bulk = require('bulk-require');
var sections = bulk(__dirname, [ 'data/**/*.js', 'render/*.js' ]);
console.log(sections);

You can run this program in node directly:

$ node glob.js
{ data: 
   { cats: { [Function] index: [Circular], meow: [Object] },
     dogs: { [Function] index: [Circular], small: [Object], wolf: [Object] },
     owners: { data: [Object] } },
  render: { x: { oneoneone: 111, twotwotwo: 222 } } }

and use bulkify as a transform, yielding the same output:

$ browserify -t bulkify glob.js | node
{ data: 
   { cats: { [Function] index: [Function], meow: [Object] },
     dogs: { [Function] index: [Function], small: [Object], wolf: [Object] },
     owners: { data: [Object] } },
  render: { x: { oneoneone: 111, twotwotwo: 222 } } }

methods

var bulkify = require('bulkify')

var b = bulkify(file, opts)

Return a transform stream b for file, rewriting require('bulk-require') calls with inline require calls.

You can optionally set extra variables for the static evaluation with opts.vars.

install

With npm, do:

npm install bulkify

license

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial