Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Clone in Desktop Download ZIP
JavaScript
Branch: master

1.0.1

latest commit 11f52ddf92
@sebmck authored
Failed to load latest commit information.
README.md 1.0.1
index.js 1.0.1
package.json 1.0.1

README.md

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.

Something went wrong with that request. Please try again.