aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.mjs
blob: f58aa151ffb3603a1c936a47ed019387d6c1acab (plain)
1
2
3
4
5
6
7
8
9
10
11
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}`);