$ npm install try-resolve
var resolve = require("try-resolve");
filenameis a filename to be resolved.
requireis an optional instance of the
requirefunction from any file.
null if the file can't be required, otherwise it returns an absolute filename string.
if "/home/sebastian/file"// this file can be requiredelse// it can't
Resolve a filename relative to the cwd.