Skip to content

Libraries

Bare

JavaScript runtime for the worker that owns native storage, networking and inference.

Verified 19 October 2026

Keep the UI responsive while a worker loads a model or exchanges data with a peer.

Status in Unstoppable Stack

Bare is not Node.js: use the documented bare-* modules and communicate with the renderer through IPC.

How it works

Bare executes JavaScript outside the browser. In this stack it runs long-lived worker code while the renderer handles the UI.

It has a small runtime surface. File access, operating-system details and other services come from installed bare-* packages rather than Node's built-in modules.

The example runs a finite worker-style task in Bare. Hosting it inside a desktop app additionally requires the scaffold's IPC bridge.

Run an example

Use Node 22.17+ and npm for installation. Start in a new directory for this example so its ./data storage cannot collide with another example. Install the Bare executable first with npm install -g bare. The script runs in Bare, not Node.

bash
mkdir bare-demo
cd bare-demo
npm init -y

Save as example.mjs:

js
const task = { id: 'note-1', text: 'Hello from Bare' }
const message = JSON.stringify(task)
console.log(JSON.parse(message).text)
await new Promise(resolve => setTimeout(resolve, 10))
console.log('Worker task complete')

Run from this example directory:

bash
bare example.mjs

Expected result

Hello from Bare Worker task complete

Example verification

The code shown here ran successfully in a local check on 19 October 2026. This verifies the small example, not production readiness, public-network reachability or every platform.

API essentials

  • bare example.mjs: run an ES module with the Bare executable.
  • Bare.IPC: the communication pipe supplied when a host launches a worker; it is not supplied by this standalone example.
  • bare-fs, bare-process and b4a: explicit dependencies when code needs filesystem, process or Buffer-like functionality.

Troubleshooting and limits

  • A node:* import belongs to Node.js, not this runtime. Choose the corresponding bare-* module and install it.
  • Do not assume browser APIs or a global Buffer are available. Keep browser-dependent UI code in the renderer.
  • If bare is not found after installation, check your npm global bin directory and open a new terminal.

Next steps

Need help? Report an issue with your CLI version, platform, command and first relevant error.