This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

try-resolve

1.0.1 • Public • Published

try-resolve

Installation

$ npm install try-resolve

Usage

var resolve = require("try-resolve");

resolve(filename, [require])

  • filename is a filename to be resolved.
  • require is an optional instance of the require function from any file.

Returns null if the file can't be required, otherwise it returns an absolute filename string.

Example

if (require("try-resolve")("/home/sebastian/file")) {
  // this file can be required
} else {
  // it can't
}

resolve.relative(filename)

Resolve a filename relative to the cwd.

Readme

Keywords

none

Package Sidebar

Install

npm i try-resolve

Weekly Downloads

147,209

Version

1.0.1

License

MIT

Last publish

Collaborators

  • sebmck