Socket
Socket
Sign inDemoInstall

autoresolve

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    autoresolve

A simple module to auto resolve module paths.


Version published
Weekly downloads
699
increased by32.64%
Maintainers
1
Install size
5.23 kB
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 17 Jul 2012

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc