modules-path

1.1.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i modules-path

Weekly Downloads

0

Version

1.1.0

License

MIT

Last publish

Collaborators

  • viringbells