Bare Docs

Bare

Bare is a zero-core JavaScript runtime for desktop and mobile: embed it in a native app, compile a script into a standalone binary, and run the same peer-to-peer core on all of them.

Bare is a zero-core JavaScript runtime. It gives you a module system, native addons, and threads; the standard library is opt-in, one bare-* module at a time. A core that small is what lets one piece of JavaScript run on desktop and mobile, inside a native iOS or Android app, and as a single standalone executable.

It's a general-purpose runtime in its own right, and it's also what carries the peer-to-peer building blocks onto every one of those targets unchanged—which is why Pear, the peer-to-peer platform, is built on it.

Reach for Bare directly when the runtime is what you want: a JavaScript core on a background thread inside a native app, or a CLI compiled into one binary. Install the pear CLI when you want the platform on top of it—peer-to-peer app distribution, over-the-air updates, and one command to stage, seed, and release. The core you write here moves onto Pear unchanged, so starting on Bare costs you nothing later. How Pear and Bare fit together lays out every layer.

Install the Bare CLI

npm i -g bare

Run a script directly, or start a REPL with no script. Full flag reference: Bare CLI.

bare script.js

Where to go next

On this page