1.1.0 • Published 6 years ago

modules-path v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

modules-path

NPM version build status Test coverage

Provides an easy way to add directories to the modules path so that all modules under can be required just as those in node_modules.

install

$ npm install --save modules-path

usage

require('modules-path').add();
require('some/local/module'); // equals require('./some/local/module');

require('modules-path').add('..');
require('some/local/module'); // equals require('../some/local/module');

require('modules-path').addAppRoot();
require('some/local/module'); // equals require(require('app-root-path') + 'some/local/module');

Based on app-module-path and caller