The Andromeda repository ships with an extensive examples/ directory covering every API surface. The examples on this site walk through a few of them in detail; the full set includes:

  • CLI / processargs.ts, env.ts, sleep.ts, command.ts
  • File system and encodingfs.ts, btoa.ts, atob.ts, blob.ts
  • Networkingfetch.ts, headers.ts, request.ts, response.ts, tls.ts
  • HTTP server — everything under examples/serve/
  • Canvascanvas.ts, canvas_advanced.ts, canvas_gradient.ts, canvas_global_alpha.ts, breakout.ts
  • Cryptocrypto.ts
  • Storagestorage.ts, sqlite.ts, cache_storage.ts
  • Streamsstreams.ts
  • URL / Web APIsurl.ts, console.ts, performance.ts, navigator.ts, event/, queue_microtask.ts
  • Croncron.ts
  • Modulesimport-map.ts, modules/, jsr.ts, std.ts
  • Window (optional)window.ts, games/
  • Lintinglint_empty_function.ts, lint_empty_statement.ts, lint_var_usage.ts
  • FizzBuzz — the obligatory fizzbuzz.ts

Data and Storage

Basics

Running Examples

Every example is a single .ts file. Run it with:

andromeda run example.ts

# Verbose, for debugging
andromeda run --verbose example.ts

Examples that produce files (e.g., the canvas examples) write to the current working directory.

See Also

Found an issue with this page?Edit on GitHub
Last updated: