# local-pkg **Repository Path**: mirrors_antfu/local-pkg ## Basic Information - **Project Name**: local-pkg - **Description**: Get information on local packages. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-07-17 - **Last Updated**: 2025-12-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # local-pkg [](https://www.npmjs.com/package/local-pkg) Get information on local packages. Works on both CJS and ESM. ## Install ```bash npm i local-pkg ``` ## Usage ```ts import { getPackageInfo, importModule, isPackageExists, resolveModule, } from 'local-pkg' isPackageExists('local-pkg') // true isPackageExists('foo') // false await getPackageInfo('local-pkg') /* { * name: "local-pkg", * version: "0.1.0", * rootPath: "/path/to/node_modules/local-pkg", * packageJson: { * ... * } * } */ // similar to `require.resolve` but works also in ESM resolveModule('local-pkg') // '/path/to/node_modules/local-pkg/dist/index.cjs' // similar to `await import()` but works also in CJS const { importModule } = await importModule('local-pkg') ``` ## Sponsors
## License [MIT](./LICENSE) License © 2021 [Anthony Fu](https://github.com/antfu)