Snow 1d0b9c5323 增加了node环境 | vor 1 Monat | |
---|---|---|
.. | ||
README.md | vor 1 Monat | |
index.js | vor 1 Monat | |
package.json | vor 1 Monat |
$ npm install try-resolve
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.
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.