MenuReference / Which Node and which browser

Docs / Reference

Which Node and which browser

A Node Snippet runs on real Node, and a Web Snippet in a real Chromium page. Both come inside the app.

On this page

The versions

Open Settings → About. It names the Node that runs Node Snippets, the Chromium that runs Web Snippets, and the V8 JavaScript engine under both.

Settings → About names the Node, Chromium and V8 your Snippets run on.

JSpark is built on Electron 44. The versions change when an update moves JSpark to a newer Electron, so check Settings → About for the ones you have.

What Node gives you

  • Node’s own behaviour. Errors and stack traces are V8’s, and setTimeout, setImmediate, process.nextTick and promises run in Node’s order.
  • Your own access. A Node Run can read and write your files, use the network and start programs, as node can. See Outside Access.
  • A folder to work in. A relative path, or one beside __dirname, lands in the The Working Folder.
  • ESM or CommonJS. A Snippet runs as a Module or a Script. See Load Mode.
  • TypeScript. JSpark compiles it to JavaScript with esbuild before Node runs it. The editor checks the types with TypeScript 5.9, inside the app.
  • Code that keeps running. A server, a timer or a watcher runs until you press Stop. The time limit (5 s by default) stops only a Run that stays busy without a pause. A recording for the Timeline has a limit on its total length. See Time and memory limits.
  • The Timeline. Only a Node Run can be recorded and replayed one Step at a time.

A page Run and a browser tab

A Web Snippet builds a real page, beside the editor, in a frame and a process of its own. A page that never finishes doesn't stop the app. Most of what works in a browser tab works here:

  • Libraries from a CDN over https:, and import maps.
  • eval and new Function, which some libraries need.
  • fetch and WebSockets, to any address.
  • The page keeps its state while its tab is not on screen.

These differ from a browser tab:

  • Only the inline scripts and on… handlers you wrote run. One added after the page started, through innerHTML or by a library, is refused, and the console says so.
  • The page is given no permissions, and nothing asks you. A request for the camera, the microphone or the clipboard is refused.
  • window.open opens a tab in your web browser, only within a second of a click or key press in the page, and at most five times in one Run.

The pictures show JSpark on a Mac. On Windows, the window looks a little different and uses Ctrl for ⌘, but everything works the same way.

Esc

Type to search every docs page.