# es-module-runner

> es module runner

Latest version **1.0.0** (published 2022-04-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install es-module-runner
pnpm add es-module-runner
yarn add es-module-runner
bun add es-module-runner
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-04-09 |
| First published | 2022-04-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | fengzilong |

## Links

- npm: https://www.npmjs.com/package/es-module-runner
- npm.io page: https://npm.io/package/es-module-runner

## Dependencies (1)

- [es-module-lexer](https://npm.io/package/es-module-lexer.md) ^0.10.5

## Recent versions

- 1.0.0 (latest) — 2022-04-09
- 0.3.0 — 2022-04-06
- 0.2.0 — 2022-04-06
- 0.1.0 — 2022-04-06

## README

# es-module-runner

[![npm version](https://badgen.net/npm/v/es-module-runner)](https://npm.im/es-module-runner) [![npm downloads](https://badgen.net/npm/dm/es-module-runner)](https://npm.im/es-module-runner)

Run es module code in browser without a bundler

## Install

```bash
npm i es-module-runner
```

## Usage

```js
import { run } from 'es-module-runner'
import * as React from 'React'

// create is exported from the sandbox
const create = run( `
import { createElement } from 'React'

export default function create() {
  return createElement( 'div' )
}
`, {
  // provide modules from outside
  modules: {
    React: {
      value: React,
      // you can decide which keys to export
      keys: Object.keys( React )
    }
  }
} )

create()
```

## License

MIT &copy; [fengzilong](https://github.com/fengzilong)

---
_Source: https://npm.io/package/es-module-runner · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
