{"_id":"resolve-cwd","_rev":"113177","name":"resolve-cwd","description":"Resolve the path of a module like `require.resolve()` but from the current working directory","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2021-06-03T10:45:44.000Z","created":"2015-12-06T16:26:27.080Z","3.0.0":"2019-04-30T12:53:23.953Z","2.0.0":"2017-04-28T09:14:24.319Z","1.0.0":"2015-12-06T16:26:27.080Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/resolve-cwd.git"},"versions":{"3.0.0":{"name":"resolve-cwd","version":"3.0.0","description":"Resolve the path of a module like `require.resolve()` but from the current working directory","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/resolve-cwd.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","cwd","current","working","directory","import"],"dependencies":{"resolve-from":"^5.0.0"},"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"55afe697667744f61fd78787526d6c4d989d75fc","bugs":{"url":"https://github.com/sindresorhus/resolve-cwd/issues"},"homepage":"https://github.com/sindresorhus/resolve-cwd#readme","_id":"resolve-cwd@3.0.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d","size":1957,"noattachment":false,"key":"/resolve-cwd/-/resolve-cwd-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve-cwd/download/resolve-cwd-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve-cwd_3.0.0_1556628803761_0.5546372287820458"},"_hasShrinkwrap":false,"publish_time":1556628803953,"_cnpm_publish_time":1556628803953},"2.0.0":{"name":"resolve-cwd","version":"2.0.0","description":"Resolve the path of a module like `require.resolve()` but from the current working directory","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/resolve-cwd.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","cwd","current","working","directory","import"],"dependencies":{"resolve-from":"^3.0.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"8c41f4b51c0b12792127ca2974101f8cac800a3b","bugs":{"url":"https://github.com/sindresorhus/resolve-cwd/issues"},"homepage":"https://github.com/sindresorhus/resolve-cwd#readme","_id":"resolve-cwd@2.0.0","_shasum":"00a9f7387556e27038eae232caa372a6a59b665a","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.7.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"00a9f7387556e27038eae232caa372a6a59b665a","size":1772,"noattachment":false,"key":"/resolve-cwd/-/resolve-cwd-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve-cwd/download/resolve-cwd-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/resolve-cwd-2.0.0.tgz_1493370863917_0.16202757763676345"},"directories":{},"publish_time":1493370864319,"_cnpm_publish_time":1493370864319,"_hasShrinkwrap":false},"1.0.0":{"name":"resolve-cwd","version":"1.0.0","description":"Resolve the path of a module like `require.resolve()` but from the current working directory","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/resolve-cwd"},"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","cwd","current","working","directory"],"dependencies":{"resolve-from":"^2.0.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"cdf0ae71148bb01e796165b1799996ae1ff2fa18","bugs":{"url":"https://github.com/sindresorhus/resolve-cwd/issues"},"homepage":"https://github.com/sindresorhus/resolve-cwd","_id":"resolve-cwd@1.0.0","_shasum":"4eaeea41ed040d1702457df64a42b2b07d246f9f","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"4eaeea41ed040d1702457df64a42b2b07d246f9f","size":1732,"noattachment":false,"key":"/resolve-cwd/-/resolve-cwd-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve-cwd/download/resolve-cwd-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1449419187080,"_cnpm_publish_time":1449419187080,"_hasShrinkwrap":false}},"readme":"# resolve-cwd [![Build Status](https://travis-ci.org/sindresorhus/resolve-cwd.svg?branch=master)](https://travis-ci.org/sindresorhus/resolve-cwd)\n\n> Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from the current working directory\n\n\n## Install\n\n```\n$ npm install resolve-cwd\n```\n\n\n## Usage\n\n```js\nconst resolveCwd = require('resolve-cwd');\n\nconsole.log(__dirname);\n//=> '/Users/sindresorhus/rainbow'\n\nconsole.log(process.cwd());\n//=> '/Users/sindresorhus/unicorn'\n\nconsole.log(resolveCwd('./foo'));\n//=> '/Users/sindresorhus/unicorn/foo.js'\n```\n\n\n## API\n\n### resolveCwd(moduleId)\n\nLike `require()`, throws when the module can't be found.\n\n### resolveCwd.silent(moduleId)\n\nReturns `undefined` instead of throwing when the module can't be found.\n\n#### moduleId\n\nType: `string`\n\nWhat you would use in `require()`.\n\n\n## Related\n\n- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module from a given path\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-cwd#readme","bugs":{"url":"https://github.com/sindresorhus/resolve-cwd/issues"},"license":"MIT"}