{"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":"sindresorhus","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://registry-npm.ywwl.com/resolve-pkg/download/resolve-pkg-3.0.0.tgz","fileCount":5,"integrity":"sha512-+pTV5JMLBind3DxxR316ATLIDQZWbK3CLq6cnqEkGu9WriiFMzsHOtIEZLaxPLotkfnLSZi2fkBFDgbSFDwYsg==","signatures":[{"sig":"MEUCIBkjnpzLr5ySuZP4W0jYw+TsP2ZdmAOzLogIl2g+hrvEAiEAnKtzIt9k7fivJ6g0hxNM/C7B3QO5K8dS0yqsJsRYQbU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6420,"size":2666,"noattachment":false,"key":"/resolve-pkg/-/resolve-pkg-3.0.0.tgz"},"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":"sindresorhus","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"},"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","publish_time":1770010284054,"_cnpm_publish_time":1770010284054,"dist-tags":{"latest":"3.0.1"}}