1.3.8 • Published 4 years ago
acquire-module v1.3.8
acquire-module
Node.js' require
function on steroids
Installation
$ npm install acquire-module
Features
along with all the existing features of require()
Usage
const acquire = require("acquire-module");
acquire (moduleName, options)
Parameter | Type | Description |
---|---|---|
moduleName | <string> | The name of the module (if present in node_modules or if paths are specified in option.paths ). Can also simply include the module path to resolve. |
options | <Object> | Additional search options for moduleName . |
options.paths | <string> , <Array>.string | Paths to one or more directories to resolve module location from. For each path specified, both the path itself and node_modules will be searched. |
options.prefix | <string> | Prefix of the given moduleName . |
• returns a module
Object
Examples
> const inquirer = acquire('inquirer')
> var _ = acquire('/core', { prefix: 'lodash' })
> const myModule = acquire('some-file.js', { paths: '.' })
> const anotherModule = acquire('file.js', {paths: './some/place/where/file/exists', prefix: 'some' })
> const nextModule = acquire('app.js', { paths: [ '.', '~/my-modules' ] })
> const doesSomething = acquire('something.js', { paths: [ 'some/place/unsure/where/file/is', '~/my-modules' , '.'] })
© 2019 Abir Bhushan \bhushan.abir@gmail.com\.
© 2017-19 Lloyd Brookes \75pound@gmail.com\.
1.3.8
4 years ago
1.3.7
4 years ago
1.3.6
4 years ago
1.3.5
4 years ago
1.3.4
4 years ago
1.3.3
4 years ago
1.3.2
4 years ago
1.3.1
4 years ago
1.3.0
4 years ago
1.2.9
4 years ago
1.2.8
4 years ago
1.2.7
4 years ago
1.2.6
4 years ago
1.2.5
4 years ago
1.2.4
4 years ago
1.2.3
4 years ago
1.2.2
4 years ago
1.2.1
4 years ago
1.2.0
4 years ago
1.1.10
4 years ago
1.1.9
4 years ago
1.1.8
4 years ago
1.1.7
4 years ago
1.1.6
4 years ago
1.1.5
5 years ago
1.1.4
5 years ago
1.1.3
5 years ago
1.1.2
5 years ago
1.1.1
5 years ago
1.0.10
5 years ago
1.0.9
5 years ago
1.0.8
5 years ago
1.0.7
5 years ago
1.0.6
5 years ago
1.0.5
5 years ago
1.0.4
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago