{"name":"local-pkg","version":"0.4.2","packageManager":"pnpm@7.5.0","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":{".":{"require":"./index.cjs","import":"./index.mjs"}},"main":"index.cjs","module":"index.mjs","types":"index.d.ts","engines":{"node":">=14"},"scripts":{"prepublishOnly":"nr build","build":"tsup shared.ts --format esm,cjs --dts && esno scripts/postbuild.ts","lint":"eslint .","release":"bumpp && npm publish","test":"node test/cjs.cjs && node test/esm.mjs"},"devDependencies":{"@antfu/eslint-config":"^0.25.2","@antfu/ni":"^0.16.3","@antfu/utils":"^0.5.2","@types/chai":"^4.3.1","@types/node":"^18.0.3","bumpp":"^8.2.1","chai":"^4.3.6","eslint":"^8.19.0","esno":"^0.16.3","find-up":"^6.3.0","tsup":"^6.1.3","typescript":"^4.7.4"},"gitHead":"f1d3c3fcea3aa058c1676ec8cdfee784e18c8aa6","_id":"local-pkg@0.4.2","_nodeVersion":"16.14.2","_npmVersion":"8.8.0","dist":{"integrity":"sha512-mlERgSPrbxU3BP4qBqAvvwlgW4MTg78iwJdGGnv7kibKjWcJksrG3t6LB5lXI93wXRDvG4NpUgJFmTG4T6rdrg==","shasum":"13107310b77e74a0e513147a131a2ba288176c2f","tarball":"http://registry-npm.ywwl.com/local-pkg/download/local-pkg-0.4.2.tgz","fileCount":9,"unpackedSize":26108,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgLKKd/52eqXh2QJ9rja3btAP10IQITZhhyVj/nKUyzgIgZLY2l6s+9+ALTv90a2wuqMmXisMkiIn8SRSq3fFWo9Y="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizPy2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpybQ/+IdxqEsFCcr591PHA0y33m+nDc79lWkWTmYDhFSqidFIKD2lt\r\n4Q4WPPX7h8rB1b6E4YG2vJILSI9V+UG3bniRJr2B8mFPcz9CmHuDKObN/cgn\r\nGhfhWlBgYAU0xqk3teO+LhkMUpnO08zHyu1YDdVEpGVZU+0nYwo1ofpLrhDo\r\nBLHgChydEuEpy0FNYwS5BQw32IMBUpHQvAlRBGFT04getN0kYE4nIPw8Phyk\r\n3raGWbZQn6ogkVnlGJJ3h/zjUNRLsszFyYUa+Sd3w1ZBkRS9ZtBTEvBynVCd\r\nWLs8NI3zfKMvrG5/fCgcLC2lwUv1szMc9MBKMGNcIaVyp/GvHeUh8YKzYwpK\r\n8uY+xeUB6r5JwFjN31rBFmQTVvBlmA2Ej0p+6kgzymSlGdsUaV6yPoYicMVL\r\nSouLfpIjUTFDMI5W7u1MEaBGJ3EhwUmedbYEGW5qMh7wJwZICy/AwnSi7cmW\r\nU5kyEktFMVxhW6Cf/RcT5UHSitlYxbM0QP/JRcyjFvpzn8awFyn07VQn4dUx\r\nf0jjhtuhAsmiBgticGb7x1hmZU+AcHhycQwVe/isSmQCjlhlrUOeqIRK8fFU\r\nD+eCBFNqon1JlPdVPNyF4sVBP5EbBzyuglGF5dpceSsYuv2yMrzEpX22vHw+\r\nx5KbiAKlSS0vNDqhX0usbR22Q375oBfl3Dg=\r\n=wx5Q\r\n-----END PGP SIGNATURE-----\r\n","size":5975,"noattachment":false,"key":"/local-pkg/-/local-pkg-0.4.2.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.2_1657601205842_0.09945404599426677"},"_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":1657601206083,"_cnpm_publish_time":1657601206083,"dist-tags":{"latest":"2.0.0"}}