🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

autoresolve

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

autoresolve

A simple module to auto resolve module paths.

0.0.3
latest
Source
npm
Version published
Weekly downloads
907
29.2%
Maintainers
1
Weekly downloads
 
Created
Source

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'));

Installation

npm install autoresolve

Example

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'));

License

Licensed under MIT. See LICENSE for more details.

Copyright (c) 2012 JP Richardson

Keywords

require

FAQs

Package last updated on 17 Jul 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts