find-module
Find a module specified by a require path using Node's module resolution.
npm install find-module
Usage
var findModule = ;;// or dont provide a callback to use the sync versionvar filename =;console;
If you pass a module path ('my-module'
) find-module by default will look for a node_modules
folder
to find my-module
. If you want to use a different module folder you can set the modules
option
;
When you resolve a path find-module by default will look for path+'.js'
and path+'.json'
if the
path does not exist. If you want to look for other kind of extensions set the extensions
option
;
Combine the modules
and extensions
settings to roll out your own module finder. A template module
finder could look like this
;
License
MIT