Hello world
Goal: Run a minimal .sjs file with superjs check.
SuperJS files use the .sjs extension. The compiler type-checks them and emits plain JavaScript.
superjs check hello.sjs
superjs build hello.sjs --out-dir distExample
export function greet(name: string): string {
return "Hello, " + name
}
const msg: string = greet("SuperJS")
console.log(msg)Key takeaways
.sjsis a typed superset of JavaScript.- Use
superjs checkbeforebuild. - Types are erased at emit — runtime is JS.
Next: Variables and types