Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
wanderer committed Dec 22, 2016
1 parent 25b6524 commit ab58e72
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,26 @@ const meteredWasm = metering.meterWASM(wasm)
```

# API
# meterJSON
## meterJSON

[./index.js:102-210](https://github.com/ewasm/wasm-metering/blob/ce319c7c12005dd6b902a6bdef839a06336bed0c/./index.js#L102-L210 "Source code on GitHub")
[./index.js:103-211](https://github.com/ewasm/wasm-metering/blob/25b65245d7dcd74f2a6a13fb090d5075df634231/./index.js#L103-L211 "Source code on GitHub")

Injects metering into a JSON output of [wasm2json](https://github.com/ewasm/wasm-json-toolkit#wasm2json)

**Parameters**

- `json` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the json tobe metered
- `constTable` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the cost table to meter with. See these notes about the default.
- `costTable`
- `costTable` (optional, default `defaultCostTable`)
- `moduleStr` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)](default 'metering')** the import string for the metering function
- `fieldStr` **\[fieldStr](default 'usegas')** the field string for the metering function
- `fieldStr` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)](default 'usegas')** the field string for the metering function

Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** This contains the fields `initailAmount`, the amount it
cost to start the module and `module`, the metered json.

# meterWASM
## meterWASM

[./index.js:221-228](https://github.com/ewasm/wasm-metering/blob/ce319c7c12005dd6b902a6bdef839a06336bed0c/./index.js#L221-L228 "Source code on GitHub")
[./index.js:222-229](https://github.com/ewasm/wasm-metering/blob/25b65245d7dcd74f2a6a13fb090d5075df634231/./index.js#L222-L229 "Source code on GitHub")

Injects metering into a webassembly binary

Expand All @@ -47,7 +47,7 @@ Injects metering into a webassembly binary
- `constTable` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the cost table to meter with. See these notes about the default.
- `costTable`
- `moduleStr` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)](default 'metering')** the import string for the metering function
- `fieldStr` **\[fieldStr](default 'usegas')** the field string for the metering function
- `fieldStr` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)](default 'usegas')** the field string for the metering function

Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** This contains the fields `initailAmount`, the amount it
cost to start the module and `module`, the metered json.
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function meterCodeEntry (entry, costTable, meterFuncIndex, cost = 0) {
* @param {Object} json the json tobe metered
* @param {Object} constTable the cost table to meter with. See these notes about the default.
* @param {String} moduleStr the import string for the metering function
* @param {fieldStr} fieldStr the field string for the metering function
* @param {String} fieldStr the field string for the metering function
* @return {Object} This contains the fields `initailAmount`, the amount it
* cost to start the module and `module`, the metered json.
*/
Expand Down Expand Up @@ -215,7 +215,7 @@ exports.meterJSON = (json, costTable = defaultCostTable, moduleStr = 'metering',
* @param {Object} wasm the wasm tobe metered
* @param {Object} constTable the cost table to meter with. See these notes about the default.
* @param {String} moduleStr the import string for the metering function
* @param {fieldStr} fieldStr the field string for the metering function
* @param {String} fieldStr the field string for the metering function
* @return {Object} This contains the fields `initailAmount`, the amount it
* cost to start the module and `module`, the metered json.
*/
Expand Down

0 comments on commit ab58e72

Please sign in to comment.