TypeScript · online compiler

Run TypeScript online

Run TypeScript 5 online — typed JavaScript, Node runtime, browser-hosted.

Firecracker microVM live per-test verdicts multi-file compile

TypeScript is JavaScript with a serious type system: interfaces, generics, mapped types, conditional types. It compiles to JS and runs on Node — you get type-safety at compile time and JavaScript's ecosystem at runtime.

ls-judge compiles TypeScript 5 with tsc and runs the emitted JS on Node inside a Firecracker microVM.

Starter code

What you get in TypeScript

Clicking "Run now" opens the playground with this exact code and a matching test case pre-loaded — passes on first Run.

typescript
TypeScript 5
const lines: string[] = [];
process.stdin.on('data', (d: Buffer) => lines.push(d.toString()));
process.stdin.on('end', () => {
  const n: number = parseInt(lines.join('').trim());
  process.stdout.write((n * 2) + '\n');
});
stdin →21
expected →42
FAQ

Common questions about TypeScript on ls-judge

Which TS?
TypeScript 5.x — with strict mode by default.
Which Node?
A recent LTS (see /lang/javascript for details).
npm packages?
No network — bring bundled source.
ts-node vs tsc + node?
We compile with tsc and run the emitted JS — more predictable than ts-node under a strict sandbox.
Further reading
Also try