Get exports of an local npm package.
npm i pkg-exports
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', ...]
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', ...]
MIT License © 2022 Anthony Fu