rute

1.0.1 • Public • Published

rute

io.js compatibility NPM version

Dependency Status Dev Dependency Status Code Climate Build Status Coverage Status

A node module that allows you to require stuff from your project root.

Usage

This will get the module at process.cwd()/middleware.js or process.cwd()/middleware/index.js

var middleware = require('rute')('middleware');

You can also change where the root that it starts from Note that the arguments get passed into path.resolve. Make sure that the path you put in is an absolute path.

require('rute').root(__dirname, '../');

Note that you can only call .root() successfully once, and you must do it before you use it to require anything using rute. This prevents any unexpected behavior when trying to change the root that rute used. I may be convinced in the future to make a more dynamic system.

Issues

I accept pull requests (as long as it doesn't detract from the original purpose of the module)

It shouldn't be do hard to understand the code. It less lines of code than this README.

Readme

Keywords

Package Sidebar

Install

npm i rute

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • ksmithut