Skip to content
Include local NodeJS modules relative to your root path
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
tests
.editorconfig
.gitignore
.npmignore
.travis.yml
CONTRIBUTING.md
README.md
getmodule-logo.png
gulpfile.js
index.js
package.json

README.md

Get Module

Include local NodeJS modules relative to your root path

Get Module

NPM version Build Status Coverage Status Code Climate

NPM

Installation

npm i --save getmodule

Usage

Add getmodule on top of your app.js (or main file of your app):

require( 'getmodule' );

Now, you can call any module based on root path of your application.

If your module is on app/modules/mymodule.js, but you're calling it on the file app/controllers/controller.js; in tradicional mode, you needed to do:

var mymodule = require( '../modules/mymodule' );

But with getmodule, you just need type this:

var mymodule = getmodule( 'app/modules/mymodule' );

Contributing

Check CONTRIBUTING.md

License

MIT License © Fernando Daciuk

You can’t perform that action at this time.