{"_id":"resolve-from","_rev":"2136","name":"resolve-from","description":"Resolve the path of a module like `require.resolve()` but from a given path","dist-tags":{"latest":"5.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2021-06-03T09:56:06.000Z","created":"2014-07-20T00:34:24.210Z","5.0.0":"2019-04-15T04:06:25.601Z","4.0.0":"2017-09-23T09:48:16.876Z","3.0.0":"2017-04-28T07:58:15.268Z","2.0.0":"2015-11-29T05:09:13.029Z","1.0.1":"2015-10-05T14:33:18.756Z","1.0.0":"2014-07-20T00:34:24.210Z"},"users":{"antixrist":true,"stringparser":true,"max_devjs":true,"gggauravgandhi":true,"jlsjonas":true,"robmcguinness":true,"arcticicestudio":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/resolve-from.git"},"versions":{"5.0.0":{"name":"resolve-from","version":"5.0.0","description":"Resolve the path of a module like `require.resolve()` but from a given path","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/resolve-from.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["require","resolve","path","module","from","like","import"],"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"53f4a1b40f972dbfc4dda9627d24068000eae897","bugs":{"url":"https://github.com/sindresorhus/resolve-from/issues"},"homepage":"https://github.com/sindresorhus/resolve-from#readme","_id":"resolve-from@5.0.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"c35225843df8f776df21c57557bc087e9dfdfc69","size":2333,"noattachment":false,"key":"/resolve-from/-/resolve-from-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve-from/download/resolve-from-5.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve-from_5.0.0_1555301185445_0.996189064165252"},"_hasShrinkwrap":false,"publish_time":1555301185601,"_cnpm_publish_time":1555301185601},"4.0.0":{"name":"resolve-from","version":"4.0.0","description":"Resolve the path of a module like `require.resolve()` but from a given path","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/resolve-from.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["require","resolve","path","module","from","like","import"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"60cd04e69135b96b98b848fff719b1276a5610c0","bugs":{"url":"https://github.com/sindresorhus/resolve-from/issues"},"homepage":"https://github.com/sindresorhus/resolve-from#readme","_id":"resolve-from@4.0.0","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"4abcd852ad32dd7baabfe9b40e00a36db5f392e6","size":2149,"noattachment":false,"key":"/resolve-from/-/resolve-from-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve-from/download/resolve-from-4.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve-from-4.0.0.tgz_1506160096801_0.3549803947098553"},"directories":{},"publish_time":1506160096876,"_hasShrinkwrap":false,"_cnpm_publish_time":1506160096876},"3.0.0":{"name":"resolve-from","version":"3.0.0","description":"Resolve the path of a module like `require.resolve()` but from a given path","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/resolve-from.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["require","resolve","path","module","from","like","import","path"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"c3a318d7144b9cc22488f5d2f3884b6c8c05a05a","bugs":{"url":"https://github.com/sindresorhus/resolve-from/issues"},"homepage":"https://github.com/sindresorhus/resolve-from#readme","_id":"resolve-from@3.0.0","_shasum":"b22c7af7d9d6881bc8b6e653335eebcb0a188748","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.7.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"b22c7af7d9d6881bc8b6e653335eebcb0a188748","size":2088,"noattachment":false,"key":"/resolve-from/-/resolve-from-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve-from/download/resolve-from-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/resolve-from-3.0.0.tgz_1493366293559_0.5914990743622184"},"directories":{},"publish_time":1493366295268,"_cnpm_publish_time":1493366295268,"_hasShrinkwrap":false},"2.0.0":{"name":"resolve-from","version":"2.0.0","description":"Resolve the path of a module like require.resolve() but from a given path","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/resolve-from"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["require","resolve","path","module","from","like","path"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"583e0f8df06e1bc4d1c96d8d4f2484c745f522c3","bugs":{"url":"https://github.com/sindresorhus/resolve-from/issues"},"homepage":"https://github.com/sindresorhus/resolve-from","_id":"resolve-from@2.0.0","_shasum":"9480ab20e94ffa1d9e80a804c7ea147611966b57","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"9480ab20e94ffa1d9e80a804c7ea147611966b57","size":1863,"noattachment":false,"key":"/resolve-from/-/resolve-from-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve-from/download/resolve-from-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1448773753029,"_cnpm_publish_time":1448773753029,"_hasShrinkwrap":false},"1.0.1":{"name":"resolve-from","version":"1.0.1","description":"Resolve the path of a module like require.resolve() but from a given path","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/resolve-from"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["require","resolve","path","module","from","like","path"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"bae2cf1d66c616ad2eb27e0fe85a10ff0f2dfc92","bugs":{"url":"https://github.com/sindresorhus/resolve-from/issues"},"homepage":"https://github.com/sindresorhus/resolve-from","_id":"resolve-from@1.0.1","_shasum":"26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226","size":1804,"noattachment":false,"key":"/resolve-from/-/resolve-from-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve-from/download/resolve-from-1.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1444055598756,"_cnpm_publish_time":1444055598756,"_hasShrinkwrap":false},"1.0.0":{"name":"resolve-from","version":"1.0.0","description":"Resolve the path of a module like require.resolve() but from a given path","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/resolve-from"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js"},"files":["index.js"],"keywords":["require","resolve","path","module","from","like","path"],"devDependencies":{"ava":"0.0.3"},"bugs":{"url":"https://github.com/sindresorhus/resolve-from/issues"},"homepage":"https://github.com/sindresorhus/resolve-from","_id":"resolve-from@1.0.0","_shasum":"dedda6f6f6346f0211ce4bc25aca0ca7826bb367","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"dedda6f6f6346f0211ce4bc25aca0ca7826bb367","size":1119,"noattachment":false,"key":"/resolve-from/-/resolve-from-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve-from/download/resolve-from-1.0.0.tgz"},"directories":{},"publish_time":1405816464210,"_cnpm_publish_time":1405816464210,"_hasShrinkwrap":false}},"readme":"# resolve-from [![Build Status](https://travis-ci.org/sindresorhus/resolve-from.svg?branch=master)](https://travis-ci.org/sindresorhus/resolve-from)\n\n> Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path\n\n\n## Install\n\n```\n$ npm install resolve-from\n```\n\n\n## Usage\n\n```js\nconst resolveFrom = require('resolve-from');\n\n// There is a file at `./foo/bar.js`\n\nresolveFrom('foo', './bar');\n//=> '/Users/sindresorhus/dev/test/foo/bar.js'\n```\n\n\n## API\n\n### resolveFrom(fromDirectory, moduleId)\n\nLike `require()`, throws when the module can't be found.\n\n### resolveFrom.silent(fromDirectory, moduleId)\n\nReturns `undefined` instead of throwing when the module can't be found.\n\n#### fromDirectory\n\nType: `string`\n\nDirectory to resolve from.\n\n#### moduleId\n\nType: `string`\n\nWhat you would use in `require()`.\n\n\n## Tip\n\nCreate a partial using a bound function if you want to resolve from the same `fromDirectory` multiple times:\n\n```js\nconst resolveFromFoo = resolveFrom.bind(null, 'foo');\n\nresolveFromFoo('./bar');\nresolveFromFoo('./baz');\n```\n\n\n## Related\n\n- [resolve-cwd](https://github.com/sindresorhus/resolve-cwd) - Resolve the path of a module from the current working directory\n- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path\n- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory\n- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point\n- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import a module lazily\n- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n","_attachments":{},"homepage":"https://github.com/sindresorhus/resolve-from#readme","bugs":{"url":"https://github.com/sindresorhus/resolve-from/issues"},"license":"MIT"}