1. Tuntau
  2. Learn
  3. Flare

Flare

Getting started with Flare: run TypeScript directly, install packages, bundle, test and serve, all with one flare binary.

PreviewBuilds from source
On this page
  1. Run code
  2. New project
  3. Packages
  4. Bundle
  5. Test
  6. Serve
  7. Compatibility
  8. Environment

Preview. Flare has no public release yet. Commands and options can still change.

Run code

TypeScript, JSX, ESM and CommonJS run as they are. There is no separate compile step.

flare index.ts            # run a file
flare run dev             # a package.json script (pre/post hooks run too)
flare dev                 # shorthand for a script name
flare x cowsay hi         # run a package's binary

Global flags: --cwd, --conditions, --no-cache. Compiled code is cached under ~/.flare/cache; flare cache clean empties it.

New project

flare init my-app -t api      # a Beacon server
flare init my-site -t web     # a web front end
flare init my-lib -t lib      # a library
# also: -t static, -t minimal; --js, --no-git, --no-install, -y

Packages

flare install             # install everything in package.json
flare add zod             # add a dependency
flare remove zod
flare pm trust esbuild    # allow a package's install scripts
flare login @my-scope     # a private registry (token kept in the system keychain)
  • Reads an existing package-lock.json, bun.lock or yarn.lock and installs exactly what it says.
  • Writes flare.lockb (binary, compressed); --save-text-lockfile writes a readable flare.lock.
  • Install scripts don't run unless the package is listed in trustedDependencies.
  • Honours .npmrc: scoped registries, tokens, min-release-age.

Bundle

flare build src/index.tsx --minify --sourcemap
flare build src/index.ts --format esm|iife|cjs
flare build site/index.html                 # HTML entry, hashed file names
flare build site/index.html --format sola   # precompiled .sola pages
flare build ... --compress gzip,hz --watch

Test

flare test                # all *.test.ts / *.spec.ts files, in parallel
flare test -t "login"     # only matching tests
flare test --watch
flare test -u             # update snapshots

Write tests with describe, it / test, expect, mocks, fake timers and snapshots, as in Jest or bun:test.

Serve

Flare.serve({
  port: 3000,
  fetch(req) {
    return new Response('Hello from Flare');
  },
});

Options include routes, tls, h2, h3 (HTTP/3 on the same port), websocket and reusePort. Bun.serve and node:http servers run on the same layer.

Compatibility

Flare implements Node's built-in modules and Bun's API. Checked by hand: Express 5, Fastify 5, Hono, Elysia, React 19 server rendering, ws, socket.io, pg, zod, jose and more. Packages with native binaries (.node addons) don't load yet.

Environment

Environment
VariableEffect
RAY_JIT=0|1|2Highest JIT tier to use (0 = interpreter only)
FLARE_IO_THREADSNumber of I/O threads
FLARE_TIMING=1Print where start-up time goes