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 bareRun a script directly, or start a REPL with no script. Full flag reference: Bare CLI.
bare script.jsWhere to go next
Using Bare on its own
When standalone Bare makes sense, and where the runtime-only path goes.
Bare runtime API
The Bare global: process properties, lifecycle, addons, threads.
Run on mobile & native
Embed Bare in a React Native app, type a native RPC bridge, and bundle a Bare app for distribution.
Connect to peers
Dial a peer by key with HyperDHT, or join topics with Hyperswarm—no UI, terminal only.
Store and replicate
Persist and replicate with Hypercore, manage many cores with Corestore, and share databases with Hyperbee.
Building blocks
Hypercore, Hyperbee, Hyperdrive, Autobase, HyperDHT, and Hyperswarm—the shared peer-to-peer modules Bare and Pear both run on.
Add Pear on top
Peer-to-peer app distribution, over-the-air updates, and a CLI to stage and release—running on the same Bare core.