Skip to content
This repository has been archived by the owner on Jul 27, 2018. It is now read-only.
/ wast2wasm Public archive

[OBSOLETE] converts .wast files -> .wasm

Notifications You must be signed in to change notification settings

ewasm/wast2wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SYNOPSIS

NPM Package Build Status

Translates from s-expressions to the WebAssembly binary-encoding. It wraps wabt's wast2wasm. It produces version 0x01 binaries.

INSTALL

npm install wast2wasm

USAGE

const wast2wasm = require('wast2wasm')

const wast = `
(module)
`
wast2wasm(wast, true).then(output => {
  console.log(output.buffer)
  // Uint8Array [ 0, 97, 115, 109, 1, 0, 0, 0 ]
  console.log(output.log)
  // 0000000: 0061 736d                                 ; WASM_BINARY_MAGIC
  // 0000004: 0100 0000                                 ; WASM_BINARY_VERSION
})

API

Parameters

  • text String the s-expression to convert
  • log [Bool] wether or not to produce a log (default: false)

Returns a Promise which resolves an object with the property buffer for for the compiled binary and log for the log

LICENSE

MPL-2.0

About

[OBSOLETE] converts .wast files -> .wasm

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published