forked from ewasm/wasm-json-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
28 lines (26 loc) · 629 Bytes
/
index.js
File metadata and controls
28 lines (26 loc) · 629 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
* Converts a wasm binary into a json representation
* @param {Buffer}
* @return {Array}
*/
exports.wasm2json = require('./wasm2json')
/**
* Converts a json representation to a wasm binary
* @param {Array}
* @return {Buffer}
*/
exports.json2wasm = require('./json2wasm')
/**
* Converts text to json. The only accepts text that is a simple list of opcode name and immediates
* @param {String}
* @return {Object}
* @example
* const codeStr = `
* i64.const 1
* i64.const 2
* i64.add
* `
* const json = text2json(codeStr)
*/
exports.text2json = require('./text2json')
exports.Iterator = require('./iterator')