1.0.1 • Published 9 years ago

rute v1.0.1

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

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.

1.0.1

9 years ago

1.0.0

10 years ago

0.1.0

10 years ago