# Bare





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](/bare/reference/bare/modules) 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](/p2p/reference/building-blocks/hypercore) onto every one of those targets unchanged—which is why [Pear](/), the peer-to-peer platform, is built on it.

<ProductRelationship active="bare" />

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](/pear/reference/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 the stack fits together](/p2p/explanation/how-the-stack-fits-together) lays out every layer.

## Install the Bare CLI [#install-the-bare-cli]

```sh
npm i -g bare
```

Run a script directly, or start a REPL with no script. Full flag reference: [Bare CLI](/bare/reference/bare/cli).

```sh
bare script.js
```

## Where to go next [#where-to-go-next]

<Cards>
  <Card href="/bare/explanation/use-bare-standalone" title="Using Bare on its own" description="When standalone Bare makes sense, and where the runtime-only path goes." />

  <Card href="/bare/reference/bare/runtime" title="Bare runtime API" description="The Bare global: process properties, lifecycle, addons, threads." />

  <Card href="/bare/how-to/run-on-native" title="Run on mobile & native" description="Embed Bare in a React Native app, type a native RPC bridge, and bundle a Bare app for distribution." />

  <Card href="/p2p/how-to/connect-to-peers" title="Connect to peers" description="Dial a peer by key with HyperDHT, or join topics with Hyperswarm—no UI, terminal only." />

  <Card href="/p2p/how-to/store-and-replicate" title="Store and replicate" description="Persist and replicate with Hypercore, manage many cores with Corestore, and share databases with Hyperbee." />

  <Card href="/p2p/reference/building-blocks/hypercore" title="Building blocks" description="Hypercore, Hyperbee, Hyperdrive, Autobase, HyperDHT, and Hyperswarm—the shared peer-to-peer modules Bare and Pear both run on." />

  <Card href="/pear/getting-started" title="Add Pear on top" description="Peer-to-peer app distribution, over-the-air updates, and a CLI to stage and release—running on the same Bare core." />
</Cards>
