{"name":"local-pkg","version":"1.0.0","keywords":["package"],"author":{"name":"Anthony Fu","email":"anthonyfu117@hotmail.com"},"license":"MIT","_id":"local-pkg@1.0.0","maintainers":[{"name":"antfu","email":"anthonyfu117@hotmail.com"}],"homepage":"https://github.com/antfu/local-pkg#readme","bugs":{"url":"https://github.com/antfu/local-pkg/issues"},"dist":{"shasum":"a8d14dd41e78884f199ecd8b3eedaf0d376e2167","tarball":"http://registry-npm.ywwl.com/local-pkg/download/local-pkg-1.0.0.tgz","fileCount":8,"integrity":"sha512-bbgPw/wmroJsil/GgL4qjDzs5YLTBMQ99weRsok1XCDccQeehbHA/I1oRvk2NPtr7KGZgT/Y5tPRnAtMqeG2Kg==","signatures":[{"sig":"MEUCIBBEyR7xgkS/hJk3eE9Tuqr7/u5iB8z6ZwSBxTPPX9qpAiEA9/L2itsfxN5lupSo3/+HsicdhzwayzFt+RMxRgYf+wU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17321,"size":4115,"noattachment":false,"key":"/local-pkg/-/local-pkg-1.0.0.tgz"},"main":"dist/index.cjs","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":"9b9caa9705c3ca40d68b37cd9e39204e6bafcaa6","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":"antfu","email":"anthonyfu117@hotmail.com"},"repository":{"url":"git+https://github.com/antfu/local-pkg.git","type":"git"},"_npmVersion":"10.9.0","description":"Get information on local packages.","directories":{},"sideEffects":false,"_nodeVersion":"22.12.0","dependencies":{"mlly":"^1.7.3","pkg-types":"^1.3.0"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.15.3","devDependencies":{"chai":"^5.1.2","esno":"^4.8.0","bumpp":"^9.10.0","eslint":"^9.17.0","vitest":"^2.1.8","unbuild":"^3.2.0","@antfu/ni":"^23.2.0","typescript":"^5.7.3","@types/chai":"^5.0.1","@types/node":"^22.10.5","@antfu/utils":"^8.0.0","find-up-simple":"^1.0.0","@antfu/eslint-config":"^3.12.2"},"_npmOperationalInternal":{"tmp":"tmp/local-pkg_1.0.0_1736416240460_0.7638012517067181","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":1736416240635,"_cnpm_publish_time":1736416240635,"dist-tags":{"latest":"2.0.0"}}