Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/alexandre-fernandez/get-file-exports
- Owner: Alexandre-Fernandez
- License: mit
- Created: 2022-11-05T20:25:26.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-16T21:23:51.000Z (about 2 years ago)
- Last Synced: 2024-10-28T15:31:07.268Z (about 2 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/get-file-exports
- Size: 3.74 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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" }
```