# e-emscripten

> ``` npm i e-emscripten ```

Latest version **0.1.4** (published 2021-11-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install e-emscripten
pnpm add e-emscripten
yarn add e-emscripten
bun add e-emscripten
```

## Health

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

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

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2021-11-16 |
| First published | 2021-11-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 1 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | 阿豪boy |
| Maintainers | ahaoboy |

## Links

- npm: https://www.npmjs.com/package/e-emscripten
- npm.io page: https://npm.io/package/e-emscripten

## Dependencies (1)

- [@types/emscripten](https://npm.io/package/@types/emscripten.md) ^1.39.5

## Recent versions

- 0.1.4 (latest) — 2021-11-16
- 0.1.3 — 2021-11-15
- 0.1.2 — 2021-11-15
- 0.1.1 — 2021-11-15
- 0.1.0 — 2021-11-02

## README

# install
```
npm i e-emscripten
```

# usage
```
import { cwrap, ccall } from "e-emscripten";

interface WasmModule extends EmscriptenModule {
  cwrap: typeof cwrap;
  ccall: typeof ccall;
}

describe("blah", () => {
  it("works", () => {
    let wasmModul: WasmModule;
    const f1 = wasmModul.cwrap("test", "boolean", [
      "string",
      "string",
      "number",
    ]);
    const f2 = wasmModul.ccall(
      "test",
      "boolean",
      ["string", "string", "number"],
      ["1", "2", 2]
    );
    const a = f1("1", "1", 1);
    expect(typeof f2).toBe("number");
    expect(typeof a).toBe("boolean");
    const int_sqrt = cwrap("int_sqrt", null, ["number"]);
    int_sqrt(0);
    const int_sqrt_number = cwrap("int_sqrt", "number", ["number"]);
    int_sqrt_number(0)
  });
});

```

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