Skip to content

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 dist

Example

export function greet(name: string): string {
  return "Hello, " + name
}

const msg: string = greet("SuperJS")
console.log(msg)

Open in playground

Key takeaways

  • .sjs is a typed superset of JavaScript.
  • Use superjs check before build.
  • Types are erased at emit — runtime is JS.

Next: Variables and types

Documentation