Nondeterministic Postrequisite Metaprotocol
Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

load-module

1.0.0 • Public • Published

view on npm npm module downloads Build Status Coverage Status Dependency Status js-standard-style

load-module

Node's require with a few extra features:

  • You can specify additional folders in which to search for modules
  • You can specify a module prefix

Example

> const loadModule = require('load-module')
 
> loadModule('react-dom')
 
> loadModule('dom', { prefix: 'react-' })
 
> loadModule('something.js', { paths: '.' })
 
> loadModule('something.js', { paths: [ '.', '~/my-modules' ] })

loadModule(request, [options]) ⏏

Kind: Exported function

Param Type Description
request string The module name, directory or file to load.
[options] object
[options.prefix] string Also attempt to load the given module name with this prefix.
[options.paths] string | Array.<string> One or more additional directories in which to search for modules.

© 2017-18 Lloyd Brookes <75pound@gmail.com>. Documented by jsdoc-to-markdown.

install

npm i load-module

Downloadsweekly downloads

9,026

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability