package
transform inline bulk-require calls into statically resolvable require maps
npm install bulkifyGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
transform inline bulk-require calls into statically resolvable require maps
The bulkify function signature is compatible with browserify's transform API.
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 } } }var bulkify = require('bulkify')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.
With npm, do:
npm install bulkifyMIT
gmaclennan
gmaclennan@digital-democracy.org
Estimated unpacked size across 44 packages.
5.7 MB
Includes dependencies.
4 direct · 3 outdated
~0.4.1
5.0.12
^1.0.0
1.0.1
^1.4.5
2.0.0
^1.1.2
3.0.4