0.0.1 • Published 6 years ago
resolve-from-paths v0.0.1
resolve-from-paths
Resolve module paths from a list of predefined search paths
const resolver = require('resolve-from-paths')
resolver.add('./lib')
// add a search path
resolver.resolve( 'library.js' )
// returns ./lib/library.js if it exists
const some = require( resolver.resolve( 'some_module.js' ) )
// returns the name of the module if not found (some_module.js)
// this is helpful when using with require statements, it will error that the named
// module can't be found.
0.0.1
6 years ago