pkg-exports
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

pkg-exports

NPM version

Get exports of an local npm package.

Install

npm i pkg-exports

Usage

getExportsRuntime

Get the exports by evaluate the module in worker thread.

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.

import { getExportsStatic } from 'pkg-exports'

const exports = await getExportsStatic('vue')
console.log(exports) // ['ref', 'computed', ...]

Sponsors

License

MIT License © 2022 Anthony Fu

Readme

Keywords

none

Package Sidebar

Install

npm i pkg-exports

Weekly Downloads

186

Version

0.2.0

License

MIT

Unpacked Size

12.9 kB

Total Files

12

Last publish

Collaborators

  • antfu