Installation
Requirements, package install, TypeScript configuration and the command line tool.
AlgoBeamTS ships as a single package containing the compiler, the runtime, the provider adapters and the CLI. It targets Node 20 or newer, modern browsers, Bun and Deno through the same ES module entry point, and it has no native dependencies, so an install is a download and nothing else.
The package is published with its own type declarations, so no separate types package is needed. It is ESM only. In a Node project set type to module in package.json, or import it dynamically from CommonJS. Module resolution should be bundler or node16 in your tsconfig, and the library assumes ES2022 or later because it uses top-level await internally in the CLI entry.
The CLI is exposed as algobeam-ts and can be run without a global install. It has five verbs: check type-checks a script, build transpiles it to JavaScript, run evaluates it once against a provider, backtest simulates a strategy and writes a report, and watch tails a live stream in the terminal. Every verb accepts the same provider, symbol, timeframe and bar count flags.
For browser use, import from the same entry point and pass a provider that speaks to your own backend. Do not put a data vendor API key in front-end code — the runtime will happily use it, and so will anyone who opens the network tab. The Deploying to a Server page shows the small proxy that solves this properly.
Example
Install AlgoBeamTS
# the runtime, the compiler and the CLI ship in one package
npm install algobeam-ts
# or whichever package manager you already use
pnpm add algobeam-ts
bun add algobeam-ts
# no install step needed for a one-off run
npx algobeam-ts run ./scripts/momentum-ribbon.algo \
--provider binance \
--symbol BTCUSDT \
--tf 1h \
--bars 300 \
--out jsonCopy it, change one input, and run it again — the numbers are deterministic, so a difference in the output is always a difference you made.