{"name":"local-pkg","version":"0.4.0","description":"Get information on local packages.","keywords":["package"],"engines":{"node":">=14"},"homepage":"https://github.com/antfu/local-pkg#readme","bugs":{"url":"https://github.com/antfu/local-pkg/issues"},"repository":{"type":"git","url":"git+https://github.com/antfu/local-pkg.git"},"funding":{"url":"https://github.com/sponsors/antfu"},"license":"MIT","author":"Anthony Fu <anthonyfu117@hotmail.com>","sideEffects":false,"exports":{".":{"require":"./index.cjs","import":"./index.mjs"}},"main":"index.cjs","module":"index.mjs","types":"index.d.ts","dependencies":{"mlly":"^0.2.2"},"devDependencies":{"@antfu/eslint-config":"^0.7.0","@antfu/ni":"^0.7.0","@antfu/utils":"^0.3.0","@types/chai":"^4.2.22","@types/node":"^16.7.1","bumpp":"^6.0.6","chai":"^4.3.4","eslint":"^7.32.0","esno":"^0.9.1","find-up":"^6.1.0","tsup":"^5.2.1","typescript":"^4.3.5"},"scripts":{"build":"tsup shared.ts --format esm,cjs --dts && esno scripts/postbuild.ts","release":"bumpp --commit --push --tag && pnpm publish","test":"node test/cjs.cjs && node test/esm.mjs"},"_id":"local-pkg@0.4.0","_integrity":"sha512-2XBWjO/v63JeR1HPzLJxdTVRQDB84Av2p2KtBA5ahvpyLUPubcAU6iXlAJrONcY7aSqgJhXxElAnKtnYsRolPQ==","_resolved":"/Users/antfu/i/local-pkg/local-pkg-0.4.0.tgz","_from":"file:local-pkg-0.4.0.tgz","_nodeVersion":"16.6.2","_npmVersion":"7.20.3","dist":{"integrity":"sha512-2XBWjO/v63JeR1HPzLJxdTVRQDB84Av2p2KtBA5ahvpyLUPubcAU6iXlAJrONcY7aSqgJhXxElAnKtnYsRolPQ==","shasum":"e6221171813d5a0812dd84fa80ffb1c8fcc00531","tarball":"http://registry-npm.ywwl.com/local-pkg/download/local-pkg-0.4.0.tgz","fileCount":9,"unpackedSize":26388,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCD2ap7IXbqTU7nv3aBXAzzFRL9penndssriETtqdu2LgIgdqvvRWd5awN7GaG4dPP5vGQwqlNLG3LiUFEkv+cVs3Y="}],"size":6122,"noattachment":false,"key":"/local-pkg/-/local-pkg-0.4.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.4.0_1634105512996_0.5104884854499401"},"_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":1634105513122,"_cnpm_publish_time":1634105513122,"dist-tags":{"latest":"2.0.0"}}