Speedy.js Compiler
raw JSON → 0.0.19 verified Fri May 01 auth: no javascript abandoned
A TypeScript to WebAssembly compiler that generates WebAssembly modules from TypeScript input files. Version 0.0.19, released as an early-stage experimental tool. Key differentiator: compiles a subset of TypeScript to optimize performance-critical code for web assembly, targeting browser and Node.js environments. Development appears stalled with no commits since 2018, making it suitable only for experimental use.
Common errors
error Cannot find module 'speedyjs-compiler' ↓
cause Package not installed or not found in node_modules.
fix
Run 'npm install speedyjs-compiler' and ensure it's listed in package.json.
error TypeError: compile is not a function ↓
cause Incorrect import method (CommonJS vs ESM).
fix
Use proper import: import { compile } from 'speedyjs-compiler'
error Error: Unsupported type 'string' at position X ↓
cause Speedy.js does not support full TypeScript type system; string is not supported.
fix
Replace TypeScript types with supported ones: use i32, f64, bool, etc.
Warnings
gotcha Supports only a subset of TypeScript types (e.g., i32, f64), not full TypeScript. ↓
fix Restrict TypeScript code to supported types: i32, i64, f32, f64, bool, void, arrays, pointers, strings.
deprecated Project appears abandoned; no updates since 2018. ↓
fix Consider alternatives like AssemblyScript or Emscripten.
gotcha Documentation is minimal; expect breaking changes or missing features. ↓
fix Refer to GitHub repo for examples and issues.
breaking Requires Node.js version 8 or higher due to WebAssembly support. ↓
fix Ensure Node.js version >= 8 or use polyfills.
Install
npm install speedyjs-compiler yarn add speedyjs-compiler pnpm add speedyjs-compiler Imports
- compile wrong
const compiler = require('speedyjs-compiler')correctimport { compile } from 'speedyjs-compiler' - default export wrong
const Speedy = require('speedyjs-compiler').defaultcorrectimport Speedy from 'speedyjs-compiler' - transpileModule
import { transpileModule } from 'speedyjs-compiler'
Quickstart
import { compile } from 'speedyjs-compiler';
const wasmModule = compile(`
function add(a: i32, b: i32): i32 {
return a + b;
}
`, { optimize: true });
console.log(wasmModule);