JavaScript adapter
Crate: parallax-adapter-js
Worker: adapters/js/worker.js
Host discovery
Order:
nodenodejs%ProgramFiles%\nodejs\node.exe
Execution model
- Subprocess:
node worker.js - Guest code runs in
vm.Script/vm.createContext - Capture works for top-level
let/const/varby appending a final expression that reads names from script scope console.log/error/warnare redirected into captured stdout/stderr buffers
Supported value subset (encode)
| JavaScript | PIR |
|---|---|
null / undefined | null |
boolean | bool |
safe integer number | int |
other number | float |
bigint | bigint |
string | string |
Buffer / Uint8Array | bytes |
Array | list |
Set | set |
plain object / Map | map |
function | function |
| other | unsupported |
Restore
- PIR
intwithin the safe integer range →number - Larger ints /
bigint→ JSBigInt mapwith string keys → plain objectlist/tuple/set→Array(set semantics not reified asSettoday)
Limitations
- No DOM / browser engine — Node.js only in 0.1
- No async migration
- Module
import/ ESM loader hooks are not provided inside the vm context