{"maintainers":[{"name":"anonymous","email":"sindresorhus@gmail.com"}],"keywords":["require","resolve","path","module","from","like","path","cwd","current","working","directory","grunt","main","entry","point"],"dist-tags":{"latest":"3.0.1"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"description":"Resolve the path of a package regardless of it having an entry point","readme":"# 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 an entry point defined in package.json, resulting in them not being resolvable by `import.meta.resolve()`. Unlike `import.meta.resolve()`, this package also resolves packages without an entry point and returns `undefined` instead of throwing when the package can't be found.\n\n## Install\n\n```sh\nnpm install resolve-pkg\n```\n\n## Usage\n\n```js\nimport resolvePackage from 'resolve-pkg';\n\n// $ npm install --save-dev grunt-svgmin\n\nresolvePackage('grunt-svgmin/tasks', {cwd: import.meta.dirname});\n//=> '/Users/sindresorhus/unicorn/node_modules/grunt-svgmin/tasks'\n\n// Fails here as Grunt tasks usually don't have a defined entry point\nimport.meta.resolve('grunt-svgmin/tasks');\n//=> Error\n```\n\n## API\n\n### resolvePackage(moduleId, options?)\n\n#### moduleId\n\nType: `string`\n\nWhat you would use in `import`.\n\n#### options\n\n##### cwd\n\nType: `string`<br>\nDefault: `process.cwd()`\n\nDirectory to resolve from.\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","repository":{"type":"git","url":"git+https://github.com/sindresorhus/resolve-pkg.git"},"users":{"sbruchmann":true,"flumpus-dev":true,"mrahmadawais":true},"bugs":{"url":"https://github.com/sindresorhus/resolve-pkg/issues"},"license":"MIT","versions":{"0.1.0":{"name":"resolve-pkg","version":"0.1.0","keywords":["require","resolve","path","module","from","like","path","cwd","current","working","directory","grunt","main","entry","point"],"author":{"url":"sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"resolve-pkg@0.1.0","maintainers":[{"name":"anonymous","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/resolve-pkg","bugs":{"url":"https://github.com/sindresorhus/resolve-pkg/issues"},"dist":{"shasum":"02cc993410e2936962bd97166a1b077da9725531","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/resolve-pkg/-/resolve-pkg-0.1.0.tgz","integrity":"sha512-x11rPP22t6W9p+eSOhDeT6whjFGmsZQf76rDq5gtbgh9UdBxZeR1PuW6sYkCyN/IrD2hpJ0yYn0hE1toHAadEw==","signatures":[{"sig":"MEQCIB0Jp2A7aodfCrH/sliwInGCHq3k7xvK+B7AbxomzEDKAiA7Mc61mP+c2PsR4hBpcRg0XTXZv1x9HKkmNZotFK2Muw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","files":["index.js"],"_shasum":"02cc993410e2936962bd97166a1b077da9725531","engines":{"node":">=0.10.0"},"gitHead":"b23eb5e6f61eb684345edd4c33f00dcde9f10bc8","scripts":{"test":"xo && ava"},"_npmUser":{"name":"anonymous","email":"sindresorhus@gmail.com"},"repository":{"url":"https://github.com/sindresorhus/resolve-pkg","type":"git"},"_npmVersion":"2.14.7","description":"Resolve the path of a package regardless of it having an entry","directories":{},"_nodeVersion":"4.2.1","dependencies":{"resolve-from":"^2.0.0"},"devDependencies":{"xo":"*","ava":"*","grunt-svgmin":"3.1.0"}},"0.2.0":{"name":"resolve-pkg","version":"0.2.0","keywords":["require","resolve","path","module","from","like","path","cwd","current","working","directory","grunt","main","entry","point"],"author":{"url":"sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"resolve-pkg@0.2.0","maintainers":[{"name":"anonymous","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/resolve-pkg#readme","bugs":{"url":"https://github.com/sindresorhus/resolve-pkg/issues"},"dist":{"shasum":"515ff7a6091dcc157e50e0ba8ca428dbb88540d6","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/resolve-pkg/-/resolve-pkg-0.2.0.tgz","integrity":"sha512-22vfX7GV4DvKur47CRcyir0fYHMlToigt4AzFIeHfcwJqCzoIzccNXJxQ7iKQQnnnLjkerdeiUkSNQgT9Zzc+w==","signatures":[{"sig":"MEUCIQDaVXrx9WebILTIyzjAW4g9Pumuz6p+oCX9fTno8HEFZwIgLCJa261e3PRAp6HrPhZqVU5fAgjFczIqPoUQYPaUTz8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","files":["index.js"],"_shasum":"515ff7a6091dcc157e50e0ba8ca428dbb88540d6","engines":{"node":">=0.10.0"},"gitHead":"b3fbd48c0c59696a71b420ce41779e59e5872b6b","scripts":{"test":"xo && ava"},"_npmUser":{"name":"anonymous","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/resolve-pkg.git","type":"git"},"_npmVersion":"2.15.5","description":"Resolve the path of a package regardless of it having an entry point","directories":{},"_nodeVersion":"4.4.5","dependencies":{"resolve-from":"^2.0.0"},"devDependencies":{"xo":"*","ava":"*","grunt-svgmin":"3.3.0","@someprivate/module-test":"file:./fixtures/private-module-test"},"_npmOperationalInternal":{"tmp":"tmp/resolve-pkg-0.2.0.tgz_1470428839804_0.34364057146012783","host":"packages-12-west.internal.npmjs.com"}},"1.0.0":{"name":"resolve-pkg","version":"1.0.0","keywords":["require","resolve","path","module","from","like","path","cwd","current","working","directory","grunt","main","entry","point"],"author":{"url":"sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"resolve-pkg@1.0.0","maintainers":[{"name":"anonymous","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/resolve-pkg#readme","bugs":{"url":"https://github.com/sindresorhus/resolve-pkg/issues"},"dist":{"shasum":"e19a15e78aca2e124461dc92b2e3943ef93494d9","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/resolve-pkg/-/resolve-pkg-1.0.0.tgz","integrity":"sha512-L0/+vjdV3UjcQaXRlQcObpCyySS8GEqVNYGYRDAGlYOcw4J1y33WMIAD3XvYWIPnBeyN5Ilp5RHoifs3gR1S2g==","signatures":[{"sig":"MEUCICpq4bVA5CPjYMg8sfcsSgYAFwczxcjrtvP1SAmiH+drAiEA6hCH6Y+u5ouO3f4DveNd1LpH5p7qiU7RX92deiYfIrY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","files":["index.js"],"_shasum":"e19a15e78aca2e124461dc92b2e3943ef93494d9","engines":{"node":">=4"},"gitHead":"96cae747f7a5a00fe0a5e1f6f026b14aeb63f1f6","scripts":{"test":"xo && ava"},"_npmUser":{"name":"anonymous","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/resolve-pkg.git","type":"git"},"_npmVersion":"2.15.11","description":"Resolve the path of a package regardless of it having an entry point","directories":{},"_nodeVersion":"4.6.2","dependencies":{"resolve-from":"^2.0.0"},"devDependencies":{"xo":"*","ava":"*","grunt-svgmin":"^4.0.0","@someprivate/module-test":"file:./fixtures/private-module-test"},"_npmOperationalInternal":{"tmp":"tmp/resolve-pkg-1.0.0.tgz_1484300250922_0.788734458386898","host":"packages-12-west.internal.npmjs.com"}},"2.0.0":{"name":"resolve-pkg","version":"2.0.0","keywords":["require","resolve","path","module","from","like","path","cwd","current","working","directory","grunt","main","entry","point"],"author":{"url":"sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"resolve-pkg@2.0.0","maintainers":[{"name":"anonymous","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/resolve-pkg#readme","bugs":{"url":"https://github.com/sindresorhus/resolve-pkg/issues"},"dist":{"shasum":"ac06991418a7623edc119084edc98b0e6bf05a41","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/resolve-pkg/-/resolve-pkg-2.0.0.tgz","fileCount":5,"integrity":"sha512-+1lzwXehGCXSeryaISr6WujZzowloigEofRB+dj75y9RRa/obVcYgbHJd53tdYw8pvZj8GojXaaENws8Ktw/hQ==","signatures":[{"sig":"MEUCIQDJrJWl07a7E2qSmSUZFTmg3tEvIIS+FM2PhMDPgiwBHwIga0FIDroqtXPsnOy7PEOthik56e0z7gMUrSYWQVD59CM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"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"},"engines":{"node":">=8"},"gitHead":"602fb3f95c0c0725471a8fb403c41a2e752c51ba","scripts":{"test":"xo && ava && tsd","pretest":"del node_modules/@someprivate/module-test && make-dir node_modules/@someprivate/module-test && cpy 'fixtures/private-module-test/*' node_modules/@someprivate/module-test/"},"_npmUser":{"name":"anonymous","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/resolve-pkg.git","type":"git"},"_npmVersion":"6.9.0","description":"Resolve the path of a package regardless of it having an entry point","directories":{},"_nodeVersion":"8.15.0","dependencies":{"resolve-from":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^0.24.0","ava":"^1.4.1","tsd":"^0.7.2","cpy-cli":"^2.0.0","del-cli":"^1.1.0","grunt-svgmin":"^6.0.0","make-dir-cli":"^2.0.0","@someprivate/module-test":"file:./fixtures/private-module-test"},"_npmOperationalInternal":{"tmp":"tmp/resolve-pkg_2.0.0_1555417437158_0.004611785738547258","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"resolve-pkg","version":"3.0.0","keywords":["require","resolve","path","module","from","like","path","cwd","current","working","directory","grunt","main","entry","point"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"resolve-pkg@3.0.0","maintainers":[{"name":"anonymous","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/resolve-pkg#readme","bugs":{"url":"https://github.com/sindresorhus/resolve-pkg/issues"},"dist":{"shasum":"8d259050e0f11cb94d14603fa626dac3f50634e2","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/resolve-pkg/-/resolve-pkg-3.0.0.tgz","fileCount":5,"integrity":"sha512-+pTV5JMLBind3DxxR316ATLIDQZWbK3CLq6cnqEkGu9WriiFMzsHOtIEZLaxPLotkfnLSZi2fkBFDgbSFDwYsg==","signatures":[{"sig":"MEUCIBkjnpzLr5ySuZP4W0jYw+TsP2ZdmAOzLogIl2g+hrvEAiEAnKtzIt9k7fivJ6g0hxNM/C7B3QO5K8dS0yqsJsRYQbU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6420},"type":"module","types":"./index.d.ts","engines":{"node":">=20"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"ab38272057787ccd6580405e90ec695e2783146e","scripts":{"test":"xo && ava && tsd","pretest":"del node_modules/@someprivate/module-test && make-dir node_modules/@someprivate/module-test && cpy 'fixtures/private-module-test/*' node_modules/@someprivate/module-test/"},"_npmUser":{"name":"anonymous","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/resolve-pkg.git","type":"git"},"_npmVersion":"11.7.0","description":"Resolve the path of a package regardless of it having an entry point","directories":{},"sideEffects":false,"_nodeVersion":"25.3.0","_hasShrinkwrap":false,"devDependencies":{"xo":"^1.2.3","ava":"^6.4.1","tsd":"^0.33.0","cpy-cli":"^6.0.0","del-cli":"^7.0.0","grunt-svgmin":"^7.0.0","make-dir-cli":"^4.0.0","is-safe-filename":"^0.1.1","@someprivate/module-test":"file:./fixtures/private-module-test"},"_npmOperationalInternal":{"tmp":"tmp/resolve-pkg_3.0.0_1770010283908_0.7276422358109584","host":"s3://npm-registry-packages-npm-production"}},"3.0.1":{"name":"resolve-pkg","version":"3.0.1","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"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"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/ && del node_modules/aliased-pkg && make-dir node_modules/aliased-pkg && cpy 'fixtures/aliased-pkg/*' node_modules/aliased-pkg/ && del node_modules/esm-only-pkg && make-dir node_modules/esm-only-pkg && cpy 'fixtures/esm-only-pkg/*' node_modules/esm-only-pkg/ && del node_modules/nested-package-json-pkg && make-dir node_modules/nested-package-json-pkg/dist && cpy 'fixtures/nested-package-json-pkg/*' node_modules/nested-package-json-pkg/ && cpy 'fixtures/nested-package-json-pkg/dist/*' node_modules/nested-package-json-pkg/dist/","test":"xo && ava && tsd"},"keywords":["require","resolve","path","module","from","like","path","cwd","current","working","directory","grunt","main","entry","point"],"dependencies":{"find-up-simple":"^1.0.1"},"devDependencies":{"@someprivate/module-test":"file:./fixtures/private-module-test","ava":"^6.4.1","cpy-cli":"^6.0.0","del-cli":"^7.0.0","grunt-svgmin":"^7.0.0","is-safe-filename":"^0.1.1","make-dir-cli":"^4.0.0","tsd":"^0.33.0","xo":"^1.2.3"},"xo":{"ignores":["fixtures/**","temp-investigation/**"]},"gitHead":"6aaa506a06d6407eec38cf06609a09f07ea6a98d","types":"./index.d.ts","_id":"resolve-pkg@3.0.1","bugs":{"url":"https://github.com/sindresorhus/resolve-pkg/issues"},"homepage":"https://github.com/sindresorhus/resolve-pkg#readme","_nodeVersion":"25.6.0","_npmVersion":"11.8.0","dist":{"integrity":"sha512-OYIg+p3xVYwh4R0tnEKU+XZA8qiDY4y7iC+XgoC8LFbZuKHjPuuJ9mhWdSX6KYFNKvgar6hOdNj207DDI0nMfg==","shasum":"f9b6b43b85b1f5bd3cb7a7d249c290a6e423192d","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/resolve-pkg/-/resolve-pkg-3.0.1.tgz","fileCount":5,"unpackedSize":7707,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDz7mmBQ7y/ogfwmQiAnor1wDkvTLOpcZThm0fkyoQPzAIhALyHaUOBpOaJBYb6eIBX5PGFMdzUVxBovb9ygM8oSPhp"}]},"_npmUser":{"name":"anonymous","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/resolve-pkg_3.0.1_1770879575287_0.1902462365005655"},"_hasShrinkwrap":false}},"name":"resolve-pkg","time":{"created":"2015-12-19T17:23:21.170Z","modified":"2026-02-12T06:59:35.608Z","0.1.0":"2015-12-19T17:23:21.170Z","0.2.0":"2016-08-05T20:27:21.518Z","1.0.0":"2017-01-13T09:37:31.164Z","2.0.0":"2019-04-16T12:23:57.260Z","3.0.0":"2026-02-02T05:31:24.054Z","3.0.1":"2026-02-12T06:59:35.507Z"},"readmeFilename":"readme.md","homepage":"https://github.com/sindresorhus/resolve-pkg#readme"}