@cckim/go-wasmer
TypeScript icon, indicating that this package has built-in type declarations

1.0.11 • Public • Published

go-wasmer

Run Go projects in nodejs and browser environments by way of WebAssembly.

Install

// pnpm
pnpm add @cckim/go-wasmer
//yarn
yarn add @cckim/go-wasmer
// npm
npm install @cckim/go-wasmer

Usage

import { runWasm } from '@cckim/go-wasmer';
runWasm('./add.wasm', [1, 2])
  .then(res => console.log(res))
// 3

Note

Due to the nature of Go wasm having to be an executable program, it will output the results to the console by default. In a browser environment, go-wasmer gets its output by intercepting console.log, but it doesn't seem to be able to do this in a nodejs environment, and will also output the results to the console.

License

MIT

Package Sidebar

Install

npm i @cckim/go-wasmer

Weekly Downloads

2

Version

1.0.11

License

MIT

Unpacked Size

57.2 kB

Total Files

13

Last publish

Collaborators

  • hubvue