Applies to JsSandbox 0.6.0. Some screenshots and option names may differ slightly in later releases.
Install and first run
JsSandbox is a desktop app, not a web app. Download the installer from the download page, run it, and open JsSandbox from the Start Menu. There is no account to create and no license key to paste.
The first tab contains a small snippet. With auto-run enabled, top-level expressions evaluate as you type and print their values in the console. You can also press Ctrl + Enter (or Cmd + Enter) to run the active tab manually.
Tabs, snippets and files
Tabs
Click + or press Ctrl + T to open a tab. Each tab has its own code, language, runtime and output. Double-click a tab name to rename it. Middle-click a tab to close it. The File menu can reopen a tab you closed by accident.
Snippets
The snippet library stores reusable pieces separately from open tabs. Open it from the library icon in the activity bar, save the active tab, search your saved snippets, and reopen one in a new tab. Snippets survive restarts.
Files and working directory
Use File → Open, Save and Save As to work with real files. JsSandbox detects the language from the file extension. The working directory picker determines where Node.js file operations and npm installs resolve, so you can point a tab at an existing project.
Tabs, snippets, themes, settings, environment variables, code and layout are stored locally. The split between editor/output and console/preview is resizable; double-click a divider to reset it.
Languages and runtimes
Language and runtime are separate controls, both available in the status bar. Language selects the compiler: JavaScript, TypeScript, JSX or TSX. Runtime selects where the compiled code executes.
Node.js runtime
Code runs in a dedicated Electron utility process with the full Node.js API. Use it for fs, path, network access, process APIs and npm packages. The working directory is the folder you selected, so relative file reads behave as expected.
import { readFile } from 'node:fs/promises'
const pkg = JSON.parse(await readFile('package.json', 'utf8'))
console.log(pkg.name, pkg.version)
Browser runtime
Browser snippets run in a sandboxed iframe with a real DOM, canvas and WebGL. The preview is interactive. This is the runtime for visual experiments, DOM work and framework previews. It has no Node.js built-ins such as fs or path.
For storage compatibility inside the sandbox, localStorage and sessionStorage fall back to an in-memory implementation. They do not share data with your normal browser.
Browser & Node.js runtime
The hybrid runtime runs code in a utility process with Node APIs plus a happy-dom DOM. Use it for scripts that need to read a file and render a result, or otherwise touch both sides. The preview is a live DOM snapshot, not an interactive Chromium view; use the Browser runtime for canvas and interaction.
| I need… | Use |
|---|---|
| Read and write files | Node.js |
| Install and import npm packages | Node.js, Browser or Hybrid (bundled for browser) |
| Draw to canvas or WebGL | Browser |
| Build an interactive UI | Browser |
| Use Node and DOM together | Browser & Node.js (DOM snapshot only) |
Runaway protection
Executions have a 20-second timeout. The Run button becomes Stop while code is running, and Clear empties the console. If a top-level expression throws a runtime error, earlier results remain visible and later independent expressions can keep running; the error is marked on the line that threw.
npm packages
Open Settings → NPM to install and remove packages in the current workspace. Enter a name, a version spec or a scoped package, and click Install. npm output streams into the log as the install runs.
# In Settings → NPM
zod
zod@3
@scope/name
# In the editor
import { z } from 'zod'
Imports are bundled with esbuild when the snippet runs, so they resolve in the Node.js and browser runtimes. After a successful install, import the package and run the tab again.
Types and autocomplete
Type declarations are loaded automatically from the workspace, including transitive type references. If a package has no bundled declarations, the status bar shows a Types badge; click it to open the NPM panel and install the matching @types/name package.
Registry and .npmrc
The NPM panel includes an editable .npmrc. Use it for a private registry, strict-ssl, auth tokens or other npm options. Save applies it to the in-app package manager; Reset restores npm defaults.
Install scripts
If npm is not detected automatically, expand Advanced in the same panel and set a custom npm path.
Environment variables
Open Settings → Environment and add key/value pairs. Enabled variables are passed to Node.js snippets through process.env and exposed as process.env in the Browser preview. They are stored locally in the app profile, not encrypted, so do not store production secrets you would not keep in a local configuration file.
const endpoint = process.env.API_ENDPOINT
console.log(endpoint)
Formatting and appearance
Prettier
Settings → Formatting configures Prettier. Enable auto-format on run, or use Actions → Format Document / Ctrl + Alt + F without running anything. Options include print width, tab width, semicolons, single quotes, quote props, JSX quotes, trailing commas, bracket spacing and arrow-function parentheses.
Themes and layout
Settings → Appearance chooses between system, light and dark mode, then a palette. Twenty themes are included: JsSandbox Dark, Daylight, Dracula, Midnight, Graphite, Bespin, Blackboard, ColorCode, Duotone Dark, Lesser Dark, Lucario, Material, Monokai, Neo, Tomorrow Night Bright, Visual Studio, Ayu, One Dark, Shades of Purple and SynthWave '84.
The same page controls font family, font size, the single-tab bar, activity bar and status bar. Settings → Editor controls line wrap, Vim keys, close brackets, ligatures, line numbers, invisibles, active line, autocomplete, linting, hover information, signature hints, minimap and tab size.
AI assistant
The assistant is optional and uses your own provider key. JsSandbox is fully functional without it.
- Open Settings → AI.
- Choose a cloud provider, a local server such as Ollama or LM Studio, or a custom OpenAI/Anthropic-compatible endpoint.
- Review the base URL, model and system prompt.
- Paste your API key. Most local servers do not need one.
- Click Save key, then Test connection.
- Open the assistant from the sparkles icon.
Supported providers include OpenAI, Anthropic, Gemini, Mistral, Groq, OpenRouter, DeepSeek, xAI, Together, Fireworks, Perplexity, Cohere, Ollama, LM Studio, vLLM and other compatible servers — more than 40 options.
What the assistant can see
You can include the current code and errors as context. The assistant can explain code, generate a snippet, or propose a replacement. When it returns code, choose Replace code, Append or Copy. You remain in control of the editor.
How keys are stored
Keys are stored per provider using Windows DPAPI on Windows or the operating system's secure storage elsewhere. They are used only in the Electron main process and are not sent back to the renderer after saving. AI requests go from your machine to the provider you chose; they do not pass through a JsSandbox server.
Console and errors
The console supports console.log, info, warn, error, debug, trace, groups, counters, timers, tables and object inspection. The final value of each top-level expression is shown with its line label. Any entry can be copied, and the output can be cleared.
Compile and runtime errors include source-mapped locations in the editor. Error Lens–style messages appear inline while you type; they update immediately and disappear when the code is fixed. You can turn the inline layer off from Settings → Editor → Linting and keep the native Monaco squiggles.
Updates
JsSandbox checks GitHub Releases automatically on launch and every four hours. When a newer version exists, it shows an update prompt and asks the operating system for a native notification. The prompt offers:
- Update now — downloads the Windows installer, verifies the transfer, opens it and closes JsSandbox so the installer can replace the files. On other platforms the download opens in your default browser.
- Remind me later — suppresses the prompt for 24 hours.
- Skip this version — suppresses the prompt until a newer version appears. A manual check still shows it.
Update checks can be disabled in Settings → Advanced. That page also accepts a custom JSON feed. A feed is a small HTTPS JSON file with version, url, notes and publishedAt fields. For private repositories, a GitHub token can be provided in the environment; unauthenticated GitHub API requests are rate-limited.
Keyboard shortcuts
| Shortcut | Action |
|---|---|
| Ctrl/Cmd + Enter | Run the current tab |
| Ctrl/Cmd + T | New tab |
| Ctrl/Cmd + I | Open npm packages |
| Ctrl/Cmd + , | Open settings |
| Ctrl/Cmd + Alt + F | Format the current tab |
| Ctrl/Cmd + A | Select all |
| Ctrl/Cmd + W | Close tab |
| Esc | Close a modal or the AI drawer |
| Drag a divider | Resize editor/output or console/preview |
| Double-click a divider | Reset that split |
Security and privacy
Node.js snippets run with the full privileges of your user account. JsSandbox is a local development tool, not a security sandbox for hostile code. Only run code you trust, especially code copied from the internet.
Browser snippets run in a sandboxed iframe with no Node.js access. The renderer uses context isolation, has no Node integration, and exposes only a narrow IPC API. Package installation scripts are opt-in. AI keys use the operating system's secure credential storage where available.
JsSandbox does not require an account and includes no telemetry. It checks GitHub Releases for updates unless you disable that. The website uses optional analytics and advertising cookies only after you consent; see the privacy policy for details.
Troubleshooting
npm is not detected
Open Settings → NPM → Advanced and set the full path to your npm executable. Make sure Node.js and npm are installed and available to your user account.
Autocomplete is missing for a package
The package may not include type declarations. Install the matching @types/name package from the NPM panel, or choose a package that ships its own types.
Browser code cannot use fs or path
That is intentional. The Browser runtime is sandboxed and has no Node.js built-ins. Switch to the Node.js runtime for filesystem access, or use Browser & Node.js if you need both APIs.
Canvas or interaction does not work in the hybrid runtime
The hybrid preview is a rendered DOM snapshot, not an interactive Chromium view. Use the Browser runtime for canvas, WebGL and interactive UI.
I missed the update notification
Open Settings → Advanced and use Check for updates. Native notifications can be suppressed by Focus Assist or your operating system notification settings.
The AI connection test fails
Check the base URL, model name and key. Local servers such as Ollama or LM Studio must be running and reachable from the app. Some providers require a specific model identifier rather than a display name.
Where to get help
Report bugs and request features on the GitHub repository, or contact Rajat directly. Include the app version, your operating system, the runtime you were using and any console output.
Keep this open
The guide is better with the app running.
Download JsSandbox and follow along. It is free, local, and does not ask for an account.