TIL (Today I Learned) is my collection of short, lightly edited, technical daily learnings. 271 and counting.
tsx, a REPL for TypeScript
Today I discovered tsx, a REPL that evaluates TypeScript. You can run it with npx: npx tsx And it evaluates TypeScript. > const onClick = (input: number):void => input + 1 undefined > onClick(1) 2 It does not check types, so you can run this just fine: > const greeting: number = "Hello world!" // Number, or string? undefined For that, you’ll need a compiler like tsc. tsx can transpile TypeScript, but it does not type-check it. tsx npm