ra

require-arr

browserify transform to replace require files using a glob and transforming them to an array of requires

Showing:

Popularity

Downloads/wk

10

GitHub Stars

1

Maintenance

Last Commit

6yrs ago

Contributors

1

Package

Dependencies

3

Size (min+gzip)

50.5KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

NPM Version Build Status

require-arr

browserify transform to replace require calls to globs to an array of requires

Overview

This transform will turn this:

module.exports = {
  run: function () {
    var deps = requireArr('./files/**/*.js', '!./files/test1.js');
  }
};

Into this:

module.exports = {
  run: function () {
    var deps = [require("./files/test2.js"), require("./files/test3.js")];
  }
};

Assuming in your filesystem the files exists.

Install

npm i --save-dev require-arr

Usage

var requireArr = require( 'require-arr' ));

var b = browserify();
b.add('./my-module');
b.transform( require-arr );
b.bundle().pipe(process.stdout);

License

MIT

Changelog

Changelog

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