wat-cli
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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
# code src/index.ts#L22
# parsedArgs src/index.ts#L26

# 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

Dependents (0)

Package Sidebar

Install

npm i wat-cli

Weekly Downloads

13

Version

1.1.0

License

MIT

Unpacked Size

496 kB

Total Files

18

Last publish

Collaborators

  • stagas