Skip to content

stagas/wat-cli

Repository files navigation

wat-cli

run .wat files from the command line

npm i wat-cli -g pnpm add wat-cli -g yarn global add wat-cli

CLI

Examples

# basic
    # view source example/basic.ts

    import { Options, run } from 'wat-cli'
    
    console.log(
      run(
        new Options({
          file: __dirname + '/math.wat',
          args: [1, '2'],
          name: 'add',
        })
      )
    )

API

# Options src/index.ts#L6
# bench(options) src/index.ts#L43

    # options

    bench(options)  =>

      void

# benchWat(fnName, params, iterations) src/index.ts#L70

    # fnName

      string

    # params

      string

    # iterations

      number

    benchWat(fnName, params, iterations)  =>

      string

# getInstance(code) src/index.ts#L64

    # code

      string

    getInstance(code)  =>

      Instance

# run(options) – Runs a function in a .wat file with the given arguments. src/index.ts#L34

    # options

    run(options)  =>

      unknown

Credits

Contributing

Fork or edit and submit a PR.

All contributions are welcome!

License

MIT © 2022 stagas