1.0.5 • Published 8 years ago
depfetch v1.0.5
depfetch
Install
npm install depfetchUsage
Fetch dependencies by convention using glob pattern.
var depfetch = require('depfetch');
depfetch.glob('**/*Module.js').then(modules => {
console.log(modules); // => array of javascript modules
});For more usage examples see tests.
Features
- Supports promises and callbacks.
- Options passed directly to node-glob.
- Asynchronous and synchronous APIs.
depfetch.glob(pattern, options, callback)
pattern {string}pattern to be matchedoptions {object}callback {function}err {Error}module {Array<module>}
- return:
Promisewith same contract as callback
Perform an asynchronous glob search for JavaScript dependencies.
depfetch.globSync(pattern, options)
pattern {string}pattern to be matchedoptions {object}- return
Arrayof JavaScript modules (module.export)
Perform a synchronous glob search for JavaScript dependencies.
Contribution
Contribution documentation can be found here.