JSLab is out: write code, watch it run as you type
JSLab is available today for Apple Silicon Macs running macOS 14 or later. It's a native JavaScript and TypeScript scratchpad. Open a tab, type, and every result, log and error lands in the output panel, tagged with the line that produced it. No project, no terminal, no build step. A first tab const orders = [ { region : "EU" , total : 120 } , { region : "US" , total : 80 } , { region : "APAC" ,…
JSLab, a JavaScript and TypeScript scratchpad for Apple Silicon Macs, debuted today. This tool eliminates the need for projects, terminals, or build steps. Simply open a tab, type your code, and watch the output appear right next to each line.
For instance, a simple code snippet such as:
```
const orders = [ { region : "EU", total : 120 }, { region : "US", total : 80 }, { region : "APAC", total : 210 } ];
const revenue = orders.reduce((s, o) => s + o.total, 0);
//? "Revenue: ${revenue}"
```
will display "Revenue: 410" next to the line where the result was calculated.
Modify the code and the output updates instantly without having to press any key. Auto Run feature automatically re-runs your code as you stop typing.
To view the output, just click on a row in the panel and the editor jumps to that line. You can also use magic comments for logging values; for example `//?` logs a value, `//? $.length` logs part of the array length.
JSLab supports three runtimes: Bun by default, Browser, or Browser & Node APIs. Each tab runs one of these runtimes.
You can install npm packages complete with types and autocomplete. The tool also lets you ask AI to read your code and generate an inline diff for review. If you accept the changes, they are saved.
Ollama runs locally, but you can also use OpenAI, Anthropic, or Google Gemini APIs if you have your own API key stored in macOS Keychain. Your data remains on your Mac, with no telemetry or crash-reporting services.
Each feature of JSLab has its own dedicated post in the Scratchpad JS series. The official documentation is available at js-lab.app/docs. Try JSLab for free for 14 days without needing an account at js-lab.app. If you encounter any issues or notice any inaccuracies, please report them in the comments.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.