mirror of
https://github.com/extism/extism.git
synced 2026-04-23 03:00:11 -04:00
Adds automated releases for crates.io, pypi, and npm for Rust, Python, and Node host SDKs respectively.
13 lines
387 B
JavaScript
13 lines
387 B
JavaScript
import { Plugin } from "./index.js";
|
|
import { readFileSync } from "fs";
|
|
|
|
let wasm = readFileSync("../wasm/code.wasm");
|
|
let p = new Plugin(wasm);
|
|
|
|
if (!p.function_exists("count_vowels")) {
|
|
console.log("no function 'count_vowels' in wasm");
|
|
process.exit(1);
|
|
}
|
|
|
|
let buf = p.call("count_vowels", process.argv[2] || "this is a test");
|
|
console.log(JSON.parse(buf.toString())['count']); |