{"name":"local-pkg","version":"1.1.1","keywords":["package"],"author":{"name":"Anthony Fu","email":"anthonyfu117@hotmail.com"},"license":"MIT","_id":"local-pkg@1.1.1","maintainers":[{"name":"antfu","email":"anthonyfu117@hotmail.com"},{"name":"sxzz","email":"sxzz@sxzz.moe"}],"homepage":"https://github.com/antfu/local-pkg#readme","bugs":{"url":"https://github.com/antfu/local-pkg/issues"},"dist":{"shasum":"f5fe74a97a3bd3c165788ee08ca9fbe998dc58dd","tarball":"http://registry-npm.ywwl.com/local-pkg/download/local-pkg-1.1.1.tgz","fileCount":8,"integrity":"sha512-WunYko2W1NcdfAFpuLUoucsgULmgDBRkdxHxWQ7mK0cQqwPiy8E1enjuRBrhLtZkB5iScJ1XIPdhVEFK8aOLSg==","signatures":[{"sig":"MEYCIQCTvPEfyG8EPFEDZpmmlTh4iS5Gxz0V0PtGA33UCm7DvQIhAOhCUauV+slvNu5GMAwRumoWmIM3W0BSlUON04oMUG9e","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20354,"size":4486,"noattachment":false,"key":"/local-pkg/-/local-pkg-1.1.1.tgz"},"main":"dist/index.cjs","pnpm":{"onlyBuiltDependencies":["esbuild"]},"type":"module","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=14"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"funding":"https://github.com/sponsors/antfu","gitHead":"c6d5c458d44075c71e1165a8069aac04887541fd","scripts":{"lint":"eslint .","test":"vitest run && node ./test/cjs.cjs && node ./test/esm.mjs","build":"unbuild","release":"bumpp && npm publish","typecheck":"tsc --noEmit","prepublishOnly":"nr build"},"_npmUser":{"name":"sxzz","email":"sxzz@sxzz.moe"},"repository":{"url":"git+https://github.com/antfu/local-pkg.git","type":"git"},"_npmVersion":"11.1.0","description":"Get information on local packages.","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"mlly":"^1.7.4","quansync":"^0.2.8","pkg-types":"^2.0.1"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.5.2","devDependencies":{"chai":"^5.2.0","esno":"^4.8.0","bumpp":"^10.0.3","eslint":"^9.21.0","vitest":"^3.0.7","unbuild":"^3.5.0","@antfu/ni":"^23.3.1","typescript":"^5.8.2","@types/chai":"^5.0.1","@types/node":"^22.13.8","@antfu/utils":"^9.1.0","find-up-simple":"^1.0.1","unplugin-quansync":"^0.3.3","@antfu/eslint-config":"^4.4.0"},"_npmOperationalInternal":{"tmp":"tmp/local-pkg_1.1.1_1741007422620_0.4259079820668983","host":"s3://npm-registry-packages-npm-production"},"readme":"# local-pkg\n\n[![NPM version](https://img.shields.io/npm/v/local-pkg?color=a1b858&label=)](https://www.npmjs.com/package/local-pkg)\n\nGet information on local packages. Works on both CJS and ESM.\n\n## Install\n\n```bash\nnpm i local-pkg\n```\n\n## Usage\n\n```ts\nimport {\n  getPackageInfo,\n  importModule,\n  isPackageExists,\n  resolveModule,\n} from 'local-pkg'\n\nisPackageExists('local-pkg') // true\nisPackageExists('foo') // false\n\nawait getPackageInfo('local-pkg')\n/* {\n *   name: \"local-pkg\",\n *   version: \"0.1.0\",\n *   rootPath: \"/path/to/node_modules/local-pkg\",\n *   packageJson: {\n *     ...\n *   }\n * }\n */\n\n// similar to `require.resolve` but works also in ESM\nresolveModule('local-pkg')\n// '/path/to/node_modules/local-pkg/dist/index.cjs'\n\n// similar to `await import()` but works also in CJS\nconst { importModule } = await importModule('local-pkg')\n```\n\n## Sponsors\n\n<p align=\"center\">\n  <a href=\"https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg\">\n    <img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg'/>\n  </a>\n</p>\n\n## License\n\n[MIT](./LICENSE) License © 2021 [Anthony Fu](https://github.com/antfu)\n","publish_time":1741007422922,"_cnpm_publish_time":1741007422922,"dist-tags":{"latest":"2.0.0"}}