{"library":"sourceror","title":"Sourceror","type":"library","description":"Sourceror is a compiler toolchain that transforms a subset of JavaScript (Source) into WebAssembly. The current stable version is 0.8.5, with a moderate release cadence of irregular updates. Key differentiators: it targets educational use via the js-slang runtime, ships TypeScript types, and requires Node's experimental WASM modules for CLI usage.","language":"javascript","status":"active","last_verified":"Fri May 01","install":{"commands":["npm install sourceror"],"cli":{"name":"sourceror","version":null}},"imports":["import sourceror from 'sourceror'","import { compile } from 'sourceror'","import { sourceLanguage } from 'sourceror'"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/source-academy/sourceror","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/sourceror","openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import sourceror from 'sourceror';\nimport { parse } from 'js-slang';\n\nconst code = `\nfunction add(x, y) {\n  return x + y;\n}\nadd(1, 2);\n`;\n\nconst ast = parse(code, { language: 'source' });\nconst wasmModule = await sourceror(ast);\nconsole.log(wasmModule); // WebAssembly.Module instance","lang":"typescript","description":"Compiles a simple Source function to a WebAssembly module using the default export.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}