{"name":"resolve-pkg","version":"2.0.0","description":"Resolve the path of a package regardless of it having an entry point","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/resolve-pkg.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"pretest":"del node_modules/@someprivate/module-test && make-dir node_modules/@someprivate/module-test && cpy 'fixtures/private-module-test/*' node_modules/@someprivate/module-test/","test":"xo && ava && tsd"},"keywords":["require","resolve","path","module","from","like","path","cwd","current","working","directory","grunt","main","entry","point"],"dependencies":{"resolve-from":"^5.0.0"},"devDependencies":{"@someprivate/module-test":"file:./fixtures/private-module-test","ava":"^1.4.1","cpy-cli":"^2.0.0","del-cli":"^1.1.0","grunt-svgmin":"^6.0.0","make-dir-cli":"^2.0.0","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"602fb3f95c0c0725471a8fb403c41a2e752c51ba","bugs":{"url":"https://github.com/sindresorhus/resolve-pkg/issues"},"homepage":"https://github.com/sindresorhus/resolve-pkg#readme","_id":"resolve-pkg@2.0.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-+1lzwXehGCXSeryaISr6WujZzowloigEofRB+dj75y9RRa/obVcYgbHJd53tdYw8pvZj8GojXaaENws8Ktw/hQ==","shasum":"ac06991418a7623edc119084edc98b0e6bf05a41","tarball":"http://registry-npm.ywwl.com/resolve-pkg/download/resolve-pkg-2.0.0.tgz","fileCount":5,"unpackedSize":5611,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJctcldCRA9TVsSAnZWagAAtF4P/37Od+iQgGfMyvu1aGxj\n6qtIJeBO0GnugbE0CFdyysxy+FkBOw3/a2psDAYHHSDwte6sdPXlnfMYn92B\nuE1TqgIsw8a4dSYJdt7ELEecqJpZN/GWby9cDx0nLzVyUP9uoP5nPrXpDS7S\nB8mct3uOYt8lEIIQP1H2MMngkeAOgUDdmKyzxmmBzgd9ZhnfnLLWKbYVTnne\nimZKVg+VFKBy8R7A2i1DOJiAv8QkGZUgla/4CFc7Ul7I/sJ2d5TdLO2hfUOh\nKxYPIDss45+FIGBhcJKlKsWXabQUT0z+pKOICLLrqg0k6dP+3JJmg/RI3RIY\nJh5r4XRuXUEsQgcB7x1Bp0MlWItAjiAnqg+7QmCP+gSJW2o3kDfYrtXRjJ3u\n/IiA3/kIL/85FfPUP8+2ikqCD9bIo0kgaM1BroTt+Qju08RL4ajT0zzbW40B\n4eCksSZBlE0eORmcxOLLkcvSXs6itw/XP3jUpVT60tRbfLkXofMbPrHhWo6p\nRBCDC4ItKnFJoFeUBpB2oksbMCK+MdbPNReZl2qhMOW8zEPuNEuYtWD0pvYT\nqSyouyRb9YuPSY1yKY2u069+ChT6tZqfguhOabMxNlRzrEgzXigmP/n981A4\nYw/yAaiSEZG/NZr6PCW78z+IowlHSahzLJsJ8Q8Mmd0m9BsOWpDFtSPb/crW\nAazU\r\n=1wVN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJrJWl07a7E2qSmSUZFTmg3tEvIIS+FM2PhMDPgiwBHwIga0FIDroqtXPsnOy7PEOthik56e0z7gMUrSYWQVD59CM="}],"size":2445,"noattachment":false,"key":"/resolve-pkg/-/resolve-pkg-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve-pkg_2.0.0_1555417437158_0.004611785738547258"},"_hasShrinkwrap":false,"readme":"# resolve-pkg [![Build Status](https://travis-ci.org/sindresorhus/resolve-pkg.svg?branch=master)](https://travis-ci.org/sindresorhus/resolve-pkg)\n\n> Resolve the path of a package regardless of it having an entry point\n\nSome packages like CLI tools and grunt tasks don't have a entry point, like `\"main\": \"foo.js\"` in package.json, resulting in them not being resolvable by `require.resolve()`. Unlike `require.resolve()`, this module also resolves packages without an entry point, returns `undefined` instead of throwing when the module can't be found, and resolves from `process.cwd()` instead `__dirname` by default.\n\n\n## Install\n\n```\n$ npm install resolve-pkg\n```\n\n\n## Usage\n\n```js\nconst resolvePkg = require('resolve-pkg');\n\n// $ npm install --save-dev grunt-svgmin\n\nresolvePkg('grunt-svgmin/tasks', {cwd: __dirname});\n//=> '/Users/sindresorhus/unicorn/node_modules/grunt-svgmin/tasks'\n\n// Fails here as Grunt tasks usually don't have a defined main entry point\nrequire.resolve('grunt-svgmin/tasks');\n//=> Error: Cannot find module 'grunt-svgmin'\n```\n\n\n## API\n\n### resolvePkg(moduleId, [options])\n\n#### moduleId\n\nType: `string`\n\nWhat you would use in `require()`.\n\n#### options\n\n##### cwd\n\nType: `string`<br>\nDefault: `process.cwd()`\n\nDirectory to resolve from.\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- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module from a given path\n- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module\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- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import a module lazily\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n","publish_time":1555417437260,"_cnpm_publish_time":1555417437260,"dist-tags":{"latest":"3.0.1"}}