{"name":"local-pkg","type":"module","version":"0.5.0","packageManager":"pnpm@8.8.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":{".":{"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.4.2","pkg-types":"^1.0.3"},"devDependencies":{"@antfu/eslint-config":"^1.0.0-beta.18","@antfu/ni":"^0.21.8","@antfu/utils":"^0.7.6","@types/chai":"^4.3.6","@types/node":"^20.8.0","bumpp":"^9.2.0","chai":"^4.3.10","eslint":"^8.50.0","esno":"^0.17.0","find-up":"^6.3.0","typescript":"^5.2.2","unbuild":"^2.0.0","vitest":"^0.34.6"},"gitHead":"46a468e1c5406c34cffd890685b8721e6c569dc0","_id":"local-pkg@0.5.0","_nodeVersion":"20.4.0","_npmVersion":"9.7.2","dist":{"integrity":"sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==","shasum":"093d25a346bae59a99f80e75f6e9d36d7e8c925c","tarball":"http://registry-npm.ywwl.com/local-pkg/download/local-pkg-0.5.0.tgz","fileCount":8,"unpackedSize":26769,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEirRvWIGstD0TiuFdi4BfRiD3ltvUFRCM7kPcrSt9igIgEZH4XORdTvJnpU6NOAgwfZLKsWlASt3z2udikx4+Nxs="}],"size":5653,"noattachment":false,"key":"/local-pkg/-/local-pkg-0.5.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.5.0_1696148568276_0.236702257741221"},"_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":1696148568472,"_cnpm_publish_time":1696148568472,"dist-tags":{"latest":"2.0.0"}}