{"_id":"req-cwd","_rev":"98108","name":"req-cwd","description":"Require a module like `require()` but from the current working directory","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2021-06-03T10:33:03.000Z","created":"2015-12-06T16:45:10.389Z","3.0.0":"2018-11-08T08:11:41.800Z","2.0.0":"2017-04-28T09:19:47.969Z","1.0.1":"2015-12-06T20:11:17.780Z","1.0.0":"2015-12-06T16:45:10.389Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/req-cwd.git"},"versions":{"3.0.0":{"name":"req-cwd","version":"3.0.0","description":"Require a module like `require()` but from the current working directory","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/req-cwd.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"keywords":["require","resolve","path","module","from","like","cwd","current","working","directory","import"],"dependencies":{"req-from":"^2.0.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"800a75b0fd54003cac624662c4103b881f30d2f8","bugs":{"url":"https://github.com/sindresorhus/req-cwd/issues"},"homepage":"https://github.com/sindresorhus/req-cwd#readme","_id":"req-cwd@3.0.0","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"d17f664a1b6f3cb3f191fb6e2d7f6f7ef7a41816","size":1758,"noattachment":false,"key":"/req-cwd/-/req-cwd-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/req-cwd/download/req-cwd-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/req-cwd_3.0.0_1541664701584_0.022874653287624058"},"_hasShrinkwrap":false,"deprecated":"Renamed to `import-cwd`.","publish_time":1541664701800,"_cnpm_publish_time":1541664701800},"2.0.0":{"name":"req-cwd","version":"2.0.0","description":"Require a module like `require()` but from the current working directory","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/req-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":{"req-from":"^2.0.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"800a75b0fd54003cac624662c4103b881f30d2f8","bugs":{"url":"https://github.com/sindresorhus/req-cwd/issues"},"homepage":"https://github.com/sindresorhus/req-cwd#readme","_id":"req-cwd@2.0.0","_shasum":"d4082b4d44598036640fb73ddea01ed53db49ebc","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.7.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"d4082b4d44598036640fb73ddea01ed53db49ebc","size":1778,"noattachment":false,"key":"/req-cwd/-/req-cwd-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/req-cwd/download/req-cwd-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/req-cwd-2.0.0.tgz_1493371186151_0.068817533319816"},"directories":{},"publish_time":1493371187969,"_hasShrinkwrap":false,"_cnpm_publish_time":1493371187969},"1.0.1":{"name":"req-cwd","version":"1.0.1","description":"Require a module like `require()` but from the current working directory","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/req-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":{"req-from":"^1.0.1"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"bd130ecd78665493682c5f38907e3a5f1ff26dd1","bugs":{"url":"https://github.com/sindresorhus/req-cwd/issues"},"homepage":"https://github.com/sindresorhus/req-cwd","_id":"req-cwd@1.0.1","_shasum":"0d73aeae9266e697a78f7976019677e76acf0fff","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"0d73aeae9266e697a78f7976019677e76acf0fff","size":1751,"noattachment":false,"key":"/req-cwd/-/req-cwd-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/req-cwd/download/req-cwd-1.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1449432677780,"_cnpm_publish_time":1449432677780,"_hasShrinkwrap":false},"1.0.0":{"name":"req-cwd","version":"1.0.0","description":"Require a module like `require()` but from the current working directory","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/req-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":{"req-from":"^1.0.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"3df8dc7c0acf47419afe767bbfa3e644d6ce567b","bugs":{"url":"https://github.com/sindresorhus/req-cwd/issues"},"homepage":"https://github.com/sindresorhus/req-cwd","_id":"req-cwd@1.0.0","_shasum":"c75db606bf0d18bfbf6529669dad7249e31041d0","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"c75db606bf0d18bfbf6529669dad7249e31041d0","size":1724,"noattachment":false,"key":"/req-cwd/-/req-cwd-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/req-cwd/download/req-cwd-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1449420310389,"_cnpm_publish_time":1449420310389,"_hasShrinkwrap":false}},"readme":"# req-cwd [![Build Status](https://travis-ci.org/sindresorhus/req-cwd.svg?branch=master)](https://travis-ci.org/sindresorhus/req-cwd)\n\n> Require a module like [`require()`](https://nodejs.org/api/globals.html#globals_require) but from the current working directory\n\n\n## Install\n\n```\n$ npm install --save req-cwd\n```\n\n\n## Usage\n\n```js\nconst reqCwd = require('req-cwd');\n\n// Target module is at '/Users/sindresorhus/unicorn/foo.js'\n\nconsole.log(__dirname);\n//=> '/Users/sindresorhus/rainbow'\n\nconsole.log(process.cwd());\n//=> '/Users/sindresorhus/unicorn'\n\nconst foo = reqCwd('./foo');\n```\n\n\n## API\n\n### reqCwd(moduleId)\n\nLike `require()`, throws when the module can't be found.\n\n### reqCwd.silent(moduleId)\n\nReturns `null` 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- [req-from](https://github.com/sindresorhus/req-from) - Require a module from a given path\n- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module from a given path\n- [resolve-cwd](https://github.com/sindresorhus/resolve-cwd) - Resolve the path of 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- [lazy-req](https://github.com/sindresorhus/lazy-req) - Require modules lazily\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n","_attachments":{},"homepage":"https://github.com/sindresorhus/req-cwd#readme","bugs":{"url":"https://github.com/sindresorhus/req-cwd/issues"},"license":"MIT"}