require-plus

2.2.1 • Public • Published

require-plus

build status Current Version dependency Status devDependency Status Coveralls

Node module for requiring a directory tree, it will throw if not a valid directory and it will also throw if the object is not exported properly or cannot be required by require.

Installation

npm install require-plus

Usage

const options = {
    blacklist: ['node_modules', '.git', '.idea'],
    extensions: ['.js','.json'],
    directory: ['./test', './some/path', './some/other/path'] // can be a string or an array
};

const plus = require('require-plus')(options);
console.log(plus);
//plus is an object containing modules exported from above directories

Todo

  • 100% code coverage
  • Handle require errors better
  • Add silent error handling option to not throw if something cannot be required by require

Readme

Keywords

Package Sidebar

Install

npm i require-plus

Weekly Downloads

0

Version

2.2.1

License

BSD-3-Clause

Unpacked Size

11.6 kB

Total Files

16

Last publish

Collaborators

  • simon-p-r