Huge News!Announcing our $40M Series B led by Abstract Ventures.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
  • Socket score

Version published
Weekly downloads
545
decreased by-24.31%
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

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc