{"name":"local-pkg","type":"module","version":"1.2.1","description":"Get information on local packages.","author":{"name":"Anthony Fu","email":"anthonyfu117@hotmail.com"},"license":"MIT","funding":"https://github.com/sponsors/antfu","homepage":"https://github.com/antfu-collective/local-pkg#readme","repository":{"type":"git","url":"git+https://github.com/antfu-collective/local-pkg.git"},"bugs":{"url":"https://github.com/antfu-collective/local-pkg/issues"},"keywords":["package"],"sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"main":"dist/index.cjs","module":"dist/index.mjs","types":"dist/index.d.ts","engines":{"node":">=14"},"dependencies":{"mlly":"^1.7.4","pkg-types":"^2.3.0","quansync":"^0.2.11"},"devDependencies":{"@antfu/eslint-config":"^5.2.1","@antfu/ni":"^25.0.0","@antfu/utils":"^9.2.0","@types/chai":"^5.2.2","@types/node":"^24.3.0","bumpp":"^10.2.3","chai":"^5.3.1","eslint":"^9.33.0","esno":"^4.8.0","find-up-simple":"^1.0.1","typescript":"^5.9.2","unbuild":"^3.6.1","unplugin-quansync":"^0.4.4","vitest":"^3.2.4"},"scripts":{"build":"unbuild","lint":"eslint .","release":"bumpp","typecheck":"tsc --noEmit","test":"vitest run && node ./test/cjs.cjs && node ./test/esm.mjs"},"_id":"local-pkg@1.2.1","_integrity":"sha512-++gUqRDEvcnN6Zhqrr+y/CkVEHhlrR96vZn3nZZPYzMcBUyBtTKzB9NadClFIsIVSsu+3i9tfk/erqy9kAmt7Q==","_resolved":"/tmp/c6ca9152103edd1a3d640986d2d62c13/local-pkg-1.2.1.tgz","_from":"file:local-pkg-1.2.1.tgz","_nodeVersion":"24.15.0","_npmVersion":"11.15.0","dist":{"integrity":"sha512-++gUqRDEvcnN6Zhqrr+y/CkVEHhlrR96vZn3nZZPYzMcBUyBtTKzB9NadClFIsIVSsu+3i9tfk/erqy9kAmt7Q==","shasum":"9628389399851d78f3b50c9236eddb02f0c31b2b","tarball":"http://registry-npm.ywwl.com/local-pkg/download/local-pkg-1.2.1.tgz","fileCount":8,"unpackedSize":20250,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/local-pkg@1.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC+Gt4oNdpedb16ftHCkq9pYoqP+HrPWq0iUTNy7X95TAIgcBMs4R5tceX43KF+qkyEQCpIVe5725QzCNo8+dwEVvs="}],"size":4443,"noattachment":false,"key":"/local-pkg/-/local-pkg-1.2.1.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:92682d5a-39b3-4d95-8271-359bd48ff881"}},"directories":{},"maintainers":[{"name":"antfu","email":"anthonyfu117@hotmail.com"},{"name":"sxzz","email":"npm@sxzz.moe"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/local-pkg_1.2.1_1779327347769_0.9536852095813713"},"_hasShrinkwrap":false,"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":1779327347922,"_cnpm_publish_time":1779327347922,"dist-tags":{"latest":"2.0.0"}}