wq

Crates.iowq
lib.rswq
version0.0.4
sourcesrc
created_at2020-04-03 19:54:00.943016
updated_at2020-04-10 06:41:04.442443
descriptiona tool for converting web assembly into json
homepage
repositoryhttps://www.github.com/richardanaya/watson/examples/wq
max_upload_size
id226033
size21,088,301
RICHΛRD ΛNΛYΛ (richardanaya)

documentation

README

wq

A simple cli tool for turning web assembly into json. This is meant to be used with other tools like jq

cargo install wq

Usage

# basic print
wq test.wasm 
# write to file
wq test.wasm test.json 
# for pipe chaining
cat simplest.wasm | wq 

Getting pretty formated

cat simplest.wasm | wq | jq
{
  "sections": [
    {
      "section_type": "type",
      "content": {
        "types": [
          {
            "value_type": "function",
            "content": {
              "inputs": [],
              "outputs": [
                "I32"
              ]
            }
          }
        ]
      }
    },
    {
      "section_type": "function",
      "content": {
        "function_types": [
          0
        ]
      }
    },
    {
      "section_type": "memory",
      "content": {
        "memories": [
          {
            "min_pages": 2,
            "max_pages": 10
          }
        ]
      }
    },
    {
      "section_type": "export",
      "content": {
        "exports": [
          {
            "export_type": "function",
            "content": {
              "name": "main",
              "index": 0
            }
          },
          {
            "export_type": "memory",
            "content": {
              "name": "memory",
              "index": 0
            }
          }
        ]
      }
    },
    {
      "section_type": "code",
      "content": {
        "code_blocks": [
          {
            "locals": [],
            "code_expression": [
              {
                "op": "I32Const",
                "params": 42
              }
            ]
          }
        ]
      }
    }
  ]
}
Commit count: 0

cargo fmt