0.0.6 • Published 8 years ago

globquire v0.0.6

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

globquire

Allows requiring a group of files using a glob pattern, optionally execute it, and returns reference objects containing name, path, module, and results.

use

const requirements = requireGlob('/my/javascript/files/**/*.js');

The result returned by globquire will look like this:

{
  foo: {
    name: 'foo',
    path: '/path/to/foo.js',
    module: [Function]
  }
}

You can specify that the module should also be executed by passing in an argument array in options, like so:

const requirements = globquire('/my/javascript/files/**/*.js', { foo: ['bar'] } );

and the results will be returned:

{
  foo: {
    name: 'foo',
    path: '/path/to/foo.js',
    module: [Function],
    result: 'some output'
  }
}
0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago