Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alexandre-fernandez/get-file-exports

Dynamic import for JavaScript and TypeScript files for both CommonJS and ECMAScript modules.
https://github.com/alexandre-fernandez/get-file-exports

Last synced: about 2 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# get-file-exports

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

## Installation

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

## Usage

- Star the [github repo](https://github.com/alexandre-fernandez/get-file-exports) 😎

```ts
import getFileExports from "get-file-exports"

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