From 7e9c65507f2ba51ff7c13cfc18cf29722b89c973 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 2 Oct 2023 01:27:55 +0900 Subject: commit files --- index.mjs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 index.mjs (limited to 'index.mjs') diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..f58aa15 --- /dev/null +++ b/index.mjs @@ -0,0 +1,12 @@ +import { readFile } from 'node:fs/promises'; +import PHPWasm from './php-wasm.mjs' + +const code = await readFile('/dev/stdin', { encoding: 'utf-8' }); + +const { ccall } = await PHPWasm(); +const result = ccall( + 'php_wasm_run', + 'number', ['string'], + [code], +); +console.log(`result: ${result}`); -- cgit v1.2.3-70-g09d2