Files
extism/node/example.js
Steve Manuel e27fae9193 v0.0.1 alpha
Co-authored-by: Zach Shipko <zach@dylib.so>
2022-08-25 14:36:47 -06:00

7 lines
265 B
JavaScript

import { Plugin } from "./index.js";
import { readFileSync } from "fs";
let wasm = readFileSync("../wasm/code.wasm");
let p = new Plugin(wasm);
let buf = p.call("count_vowels", process.argv[2] || "this is a test");
console.log(JSON.parse(buf.toString())['count']);