Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antfu/pkg-exports
Get exports of an local npm package.
https://github.com/antfu/pkg-exports
Last synced: 4 days ago
JSON representation
Get exports of an local npm package.
- Host: GitHub
- URL: https://github.com/antfu/pkg-exports
- Owner: antfu
- License: mit
- Created: 2022-06-27T14:53:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-19T15:06:36.000Z (over 1 year ago)
- Last Synced: 2025-02-09T06:12:30.295Z (12 days ago)
- Language: TypeScript
- Homepage:
- Size: 71.3 KB
- Stars: 118
- Watchers: 2
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# pkg-exports
[](https://www.npmjs.com/package/pkg-exports)
Get exports of an local npm package.
## Install
```bash
npm i pkg-exports
```## Usage
### `getExportsRuntime`
Get the exports by evaluate the module in worker thread.
```ts
import { getExportsRuntime } from 'pkg-exports'const exports = await getExportsRuntime('vue')
console.log(exports) // ['ref', 'computed', ...]
```### `getExportsStatic`
Get the exports by static analysis (only work with ESM). **Experimental**.
```ts
import { getExportsStatic } from 'pkg-exports'const exports = await getExportsStatic('vue')
console.log(exports) // ['ref', 'computed', ...]
```## Sponsors
## License
[MIT](./LICENSE) License © 2022 [Anthony Fu](https://github.com/antfu)