{"name":"local-pkg","version":"0.1.0","description":"Get information on local packages.","main":"index.cjs","module":"index.mjs","types":"index.d.ts","exports":{".":{"require":"./index.cjs","import":"./index.mjs"}},"funding":"https://github.com/sponsors/antfu","author":{"name":"Anthony Fu","email":"anthonyfu117@hotmail.com"},"license":"MIT","sideEffects":false,"bugs":{"url":"https://github.com/antfu/local-pkg/issues"},"homepage":"https://github.com/antfu/local-pkg#readme","repository":{"type":"git","url":"git+https://github.com/antfu/local-pkg.git"},"keywords":["package"],"scripts":{"release":"bumpp --commit --push --tag && pnpm publish","test":"node test/cjs.cjs && node test/esm.mjs"},"devDependencies":{"@antfu/eslint-config":"^0.7.0","@antfu/ni":"^0.7.0","@antfu/utils":"^0.3.0","@types/chai":"^4.2.22","@types/jasmine":"^3.9.1","@types/node":"^16.7.1","bumpp":"^6.0.6","chai":"^4.3.4","eslint":"^7.32.0","esno":"^0.9.1","jasmine":"^3.9.0","typescript":"^4.3.5","uvu":"^0.5.1"},"dependencies":{"mlly":"^0.2.2"},"gitHead":"b15a1e9bdaec76c83707e17b2956f97e49047176","_id":"local-pkg@0.1.0","_nodeVersion":"16.6.2","_npmVersion":"7.20.3","dist":{"integrity":"sha512-WsR2tHvRGIxcC2clC30ECb5fjywzsjQagaHIy1+ykZaHz0ByoB0OL2riHqIYA5YYnensRXLszwbzHkhKzehZDg==","shasum":"7422b2ae8fc1e3b9ef2f132b0a0e92d879df52ef","tarball":"http://registry-npm.ywwl.com/local-pkg/download/local-pkg-0.1.0.tgz","fileCount":6,"unpackedSize":7437,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAuK+XV2f/24lvjKUdcN21a5bzSRX8eunS2m5h1GRp3+AiAHYr6gujCwZbw7IoEMZ+nZalG/zSplm09tTse9qIUWgA=="}],"size":2720,"noattachment":false,"key":"/local-pkg/-/local-pkg-0.1.0.tgz"},"_npmUser":{"name":"antfu","email":"anthonyfu117@hotmail.com"},"directories":{},"maintainers":[{"name":"antfu","email":"anthonyfu117@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/local-pkg_0.1.0_1632789860550_0.1447144521681496"},"_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\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":1632789860693,"_cnpm_publish_time":1632789860693,"dist-tags":{"latest":"2.0.0"}}