This repository is a fork of antonmedv/numbr with a focus on providing a standalone playground for the Numbr language. You can run it locally with hot reload during development or export a fully static bundle that works entirely offline in a browser.
Demo: https://gustavotrott.github.io/numbr/dist/
- Node.js 18+
- npm
Install dependencies once:
npm install| Command | Description |
|---|---|
npm test |
Run the TypeScript test suite (AVA). |
npm run build:runtime |
Bundle the evaluator into public/numbr.js for development. |
npm run serve |
Build the runtime bundle and start the hot-reload server on http://localhost:3000. |
npm run build:static |
Produce a self-contained dist/ folder that you can open directly in a browser. |
-
Install dependencies (
npm install). -
Start the playground with hot reload:
npm run serve
This command automatically bundles
public/numbr.jsand runs the development server with file watching. Openhttp://localhost:3000to start using the editor. Any edits to the codebase trigger hot reload in the browser. -
Run tests whenever you modify the evaluator:
npm test
You can generate an offline-friendly bundle that does not require any server-side code.
npm run build:staticThis command creates a dist/ directory containing:
index.htmlnumbr.js(the bundled evaluator)- Additional static assets copied from
public/
Open dist/index.html directly in your browser (double-click or drag-and-drop into a tab). The runtime executes entirely in the browser and persists your number format preference and last edited document using localStorage.
- The evaluator supports locale-aware input/output. Use the Format dropdown in the editor to switch between
1,234.56and1.234,56styles. The choice is stored inlocalStorage. - When using the hot-reload server the page falls back to
/evaluatewhile waiting for the runtime bundle. The static build relies solely on the bundled runtime and does not perform any network requests.
The project inherits the MIT license from the original Numbr repository.