resolve-from
Advanced tools
Comparing version 1.0.1 to 2.0.0
14
index.js
@@ -14,7 +14,11 @@ 'use strict'; | ||
return Module._resolveFilename(moduleId, { | ||
id: fromFile, | ||
filename: fromFile, | ||
paths: Module._nodeModulePaths(fromDir) | ||
}); | ||
try { | ||
return Module._resolveFilename(moduleId, { | ||
id: fromFile, | ||
filename: fromFile, | ||
paths: Module._nodeModulePaths(fromDir) | ||
}); | ||
} catch (err) { | ||
return null; | ||
} | ||
}; |
{ | ||
"name": "resolve-from", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "Resolve the path of a module like require.resolve() but from a given path", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -5,3 +5,5 @@ # resolve-from [![Build Status](https://travis-ci.org/sindresorhus/resolve-from.svg?branch=master)](https://travis-ci.org/sindresorhus/resolve-from) | ||
Unlike `require.resolve()` it returns `null` instead of throwing when the module can't be found. | ||
## Install | ||
@@ -34,3 +36,3 @@ | ||
The directory to resolve from. | ||
Directory to resolve from. | ||
@@ -37,0 +39,0 @@ #### moduleId |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3354
19
59