{"name":"local-pkg","type":"module","version":"0.5.1","packageManager":"pnpm@9.13.2","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/local-pkg#readme","repository":{"type":"git","url":"git+https://github.com/antfu/local-pkg.git"},"bugs":{"url":"https://github.com/antfu/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"},"scripts":{"prepublishOnly":"nr build","build":"unbuild","lint":"eslint .","release":"bumpp && npm publish","typecheck":"tsc --noEmit","test":"vitest run && node ./test/cjs.cjs && node ./test/esm.mjs"},"dependencies":{"mlly":"^1.7.3","pkg-types":"^1.2.1"},"devDependencies":{"@antfu/eslint-config":"^3.9.2","@antfu/ni":"^0.23.1","@antfu/utils":"^0.7.10","@types/chai":"^5.0.1","@types/node":"^22.9.0","bumpp":"^9.8.1","chai":"^5.1.2","eslint":"^9.15.0","esno":"^4.8.0","find-up":"^6.3.0","typescript":"^5.6.3","unbuild":"^2.0.0","vitest":"^2.1.5"},"_id":"local-pkg@0.5.1","gitHead":"0b91880c3a9accfca1e372ab0faf0de3fcc0cbab","_nodeVersion":"20.18.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-9rrA30MRRP3gBD3HTGnC6cDFpaE1kVDWxWgqWJUN0RvDNAo+Nz/9GxB+nHOH0ifbVFy0hSA1V6vFDvnx54lTEQ==","shasum":"69658638d2a95287534d4c2fff757980100dbb6d","tarball":"http://registry-npm.ywwl.com/local-pkg/download/local-pkg-0.5.1.tgz","fileCount":8,"unpackedSize":27691,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCby1OqgymPfYY0HhJ6t5ibBHtdnp1F+OxpqRzWMSNJawIgHuwJuvbV9PpKPWRi1mZ/9JgCP+9FUjdQ64XIg7JRHbY="}],"size":5932,"noattachment":false,"key":"/local-pkg/-/local-pkg-0.5.1.tgz"},"_npmUser":{"name":"antfu","email":"anthonyfu117@hotmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/local-pkg_0.5.1_1731980378495_0.8418024127862362"},"_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":1731980378645,"maintainers":[{"name":"antfu","email":"anthonyfu117@hotmail.com"}],"_cnpm_publish_time":1731980378645,"dist-tags":{"latest":"2.0.0"}}