1.2.1 • Published 1 year ago

get-file-exports v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

get-file-exports

Dynamic import for JavaScript and TypeScript files for both CommonJS and ECMAScript modules.

Installation

# npm
npm install get-file-exports
# yarn
yarn add get-file-exports
# pnpm
pnpm add get-file-exports

Usage

import getFileExports from "get-file-exports"

const fileExports = getFileExports("/absolute/path/to/file.ts")
//    ^ { default: "foo", export1: "bar", export2: "baz" }