A simple module to auto resolve module paths.

npm install autoresolve
1 downloads in the last day
9 downloads in the last week
21 downloads in the last month

Node.js - autoresolve

This autoresolves package locations for you. This prevents such ugliness as:

var mypackage = require('../../../lib/models/customer');
var another = require(path.join(__dirname, 'lib/models/customer'));
var somepack = require(path.join(process.cwd(), 'lib/models/customer'));


    npm install autoresolve


`autoresolve` simply looks for your `package.json` file and considers that its base directory. If it can't find `package.json`, it then uses `process.cwd()`.

var P = require('autoresolve');
var customer = require(P('lib/models/customer'));


Licensed under MIT. See LICENSE for more details.

Copyright (c) 2012 JP Richardson

npm loves you