# wast-codegen

> WebAssembly code generator

Latest version **0.9.0** (published 2016-08-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install wast-codegen
pnpm add wast-codegen
yarn add wast-codegen
bun add wast-codegen
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.0 |
| Published | 2016-08-19 |
| First published | 2016-03-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Aliaksei Chapyzhenka |
| Maintainers | drom |
| Keywords | WebAssembly, wast, codegen |

## Links

- npm: https://www.npmjs.com/package/wast-codegen
- Repository: https://github.com/drom/wast-codegen
- Homepage: https://github.com/drom/wast-codegen#readme
- Issues: https://github.com/drom/wast-codegen/issues
- npm.io page: https://npm.io/package/wast-codegen

## Dependencies (1)

- [wast-spec](https://npm.io/package/wast-spec.md) ^0.14.0

## Recent versions

- 0.9.0 (latest) — 2016-08-19
- 0.8.0 — 2016-08-19
- 0.7.0 — 2016-08-18
- 0.6.1 — 2016-08-17
- 0.6.0 — 2016-08-16
- 0.5.1 — 2016-05-20
- 0.5.0 — 2016-05-15
- 0.4.1 — 2016-04-13
- 0.4.0 — 2016-04-11
- 0.3.1 — 2016-04-03
- 0.3.0 — 2016-03-25
- 0.1.0 — 2016-03-18
- 0.0.2 — 2016-03-17

## README

[![NPM version](https://img.shields.io/npm/v/wast-codegen.svg)](https://www.npmjs.org/package/wast-codegen)
[![Travis](https://travis-ci.org/drom/wast-codegen.svg)](https://travis-ci.org/drom/wast-codegen)
[![appVeyor](https://ci.appveyor.com/api/projects/status/l3ijsytrhmf42k6o?svg=true)](https://ci.appveyor.com/project/drom/wast-codegen)

# WebAssembly code generator

Generates S-expression WebAssembly from ([AST](https://github.com/drom/wast-spec))

## Use

### Node.js

```sh
npm i wast-codegen --save
```
```js
var codegen = require('wast-codegen');
```

## Functions

### .generate()

```js
var src = codegen.generate({
  kind: 'binop',
  type: 'i32',
  operator: 'add',
  left: {
    kind: 'get_local',
    id: {
      kind: 'identifier',
      id: 'x'
    }
  },
  right: {
    kind: 'get_local',
    id: {
      kind: 'identifier',
      id: 'y'
    }
  }
});
```

produces string `(i32.add (get_local $x) (get_local $y)`

## Testing

```sh
npm test
```

## License
MIT [LICENSE](https://github.com/drom/wast-codegen/blob/master/LICENSE).

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