{"name":"local-pkg","version":"1.1.0","keywords":["package"],"author":{"name":"Anthony Fu","email":"anthonyfu117@hotmail.com"},"license":"MIT","_id":"local-pkg@1.1.0","maintainers":[{"name":"antfu","email":"anthonyfu117@hotmail.com"},{"name":"sxzz","email":"sxzz@sxzz.moe"}],"homepage":"https://github.com/antfu/local-pkg#readme","bugs":{"url":"https://github.com/antfu/local-pkg/issues"},"dist":{"shasum":"b24ea31ae10529b83f015180e3d2e6a16246188b","tarball":"http://registry-npm.ywwl.com/local-pkg/download/local-pkg-1.1.0.tgz","fileCount":8,"integrity":"sha512-xbZBuX6gYIWrlLmZG43aAVer4ocntYO09vPy9lxd6Ns8DnR4U7N+IIeDkubinqFOHHzoMlPxTxwo0jhE7oYjAw==","signatures":[{"sig":"MEQCIFShVRYh2gHZI9dmOyq/QQSPoXfiIB4hqLUtXdETqtZyAiABL6Rq1rsJdZlQgA4gOxyt+MKHCa7Dfev8ylzXeb3apQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20018,"size":4451,"noattachment":false,"key":"/local-pkg/-/local-pkg-1.1.0.tgz"},"main":"dist/index.cjs","pnpm":{"onlyBuiltDependencies":["esbuild"]},"type":"module","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=14"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"funding":"https://github.com/sponsors/antfu","gitHead":"793484159ef41f64093df3b7971dd5a890177091","scripts":{"lint":"eslint .","test":"vitest run && node ./test/cjs.cjs && node ./test/esm.mjs","build":"unbuild","release":"bumpp && npm publish","typecheck":"tsc --noEmit","prepublishOnly":"nr build"},"_npmUser":{"name":"sxzz","email":"sxzz@sxzz.moe"},"repository":{"url":"git+https://github.com/antfu/local-pkg.git","type":"git"},"_npmVersion":"10.9.2","description":"Get information on local packages.","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"mlly":"^1.7.4","quansync":"^0.2.1","pkg-types":"^1.3.1"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.4.1","devDependencies":{"chai":"^5.2.0","esno":"^4.8.0","bumpp":"^10.0.3","eslint":"^9.21.0","vitest":"^3.0.6","unbuild":"^3.3.1","@antfu/ni":"^23.3.1","typescript":"^5.7.3","@types/chai":"^5.0.1","@types/node":"^22.13.5","@antfu/utils":"^9.1.0","find-up-simple":"^1.0.0","unplugin-quansync":"^0.3.0","@antfu/eslint-config":"^4.3.0"},"_npmOperationalInternal":{"tmp":"tmp/local-pkg_1.1.0_1740649076061_0.3236576692693822","host":"s3://npm-registry-packages-npm-production"},"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":1740649076283,"_cnpm_publish_time":1740649076283,"dist-tags":{"latest":"2.0.0"}}