Pear by Holepunch

Pear loads applications remotely from peers and allows anyone to create and share applications with peers.

Pear is an installable Peer-to-Peer (P2P) Runtime, Development & Deployment platform.

Build, share & extend unstoppable, zero-infrastructure P2P applications for Mobile, Desktop & Terminal.

Welcome to the Internet of Peers

– Holepunch, the P2P Company

Documentation

Showcase

Peer-to-Peer applications built on, deployed with, running on Pear.

Terms

  • API - Application-Programming-Interface

  • CLI - Command-Line-Interface

  • link - a pear:// link, a file:// link or an absolute/relative dir path

  • P2P - Peer-to-Peer

Legend

Throughout the documentation, indications of stability are provided. Some modules are well-established and used widely, making them highly unlikely to ever change. Other modules may be new, experimental, or known to have risks associated with their use.

The following stability indices have been used:

Stability
Description

stable

Unlikely to change or be removed in the foreseeable future

experimental

New, untested, or has known issues

deprecated

Being removed or replaced in the future

unstable

May change or be removed without warning

Reference

Pear is a native point-to-point peer-to-peer capable platform that consists of a runtime binary, an API, userland modules, a command-line interface, an on-demand daemon and an application shell to provide the capabilities to develop & deploy production P2P applications. With JavaScript and beyond.

Pear's runtime binary is built on Bare, a small and modular JavaScript runtime for desktop and mobile. Like Node.js, it provides an asynchronous, event-driven architecture for writing applications in the lingua franca of modern software. Unlike Node.js, embedding and cross-device are supported as core use cases, aiming to run just as well on mobile as desktop.

Examples

Guides

Guides on using Pear Runtime to build and share peer-to-peer applications.

How-tos

Collection of How-tos using the essential peer-to-peer building-blocks in Pear applications.

Pear Modules

The Pear global API is minimal and not intended as a standard library. Application & Integration libraries are supplied via installable modules prefixed with pear-.

Application Libraries

Pear modules related directly to application environment.

Module
Description
Systems
Stability

Uncaught exceptions & uncaught rejections crash logger

stable

Send inter-app pattern-matched object messages

stable

Receive object messages that match a given object pattern

stable

Parent-app-connected pipe, the other end of pear-run pipe

stable

Run Pear child app by link. Returns a pipe to the child pipe

stable

Receive platform and application update notifications

stable

Get the path of user-specific directories

stable

Receive wakeup events, including link clicks external to app

stable

User Interface Libraries

Pear modules that supply User Interface runtime capabilities.

Module
Description
Systems
Stability

Pear User-Interface Library for Electron"

stable

Local HTTP bridge for pear-electron applications

stable

Common Libraries

Pear modules for general usage, including applications per case.

Module
Description
Systems
Stability

Drop data, including application reset

stable

Synchronize files from link to dir peer-to-peer or from-disk

stable

Pear graceful closer. For use with pipe.autoexit = false

stable

Read Pear project information by link

stable

Parser-Serializer for pear:// links. Includes alias resolution

stable

Pear operation stream promise wrapper

stable

Set application production release version length

stable

Seed or reseed a Pear app drive by link

stable

Synchronize from-disk to app drive peer-to-peer

stable

Interleave locals into a template, sync and stream

stable

Developer Libraries

Pear modules to assist with developing & debugging

Module
Description
Systems
Stability

Securely enable remote debugging protocol over Hyperswarm

stable

For pear-electron UI apps. Frontend framework-agnostic live-reload

stable

Integration Libraries

Pear modules for runtime integrations. Such as pear-electron.

Module
Description
Systems
Stability

Read-only Hyperdrive API subset interface for application drives

stable

List of aliases for pear://<alias> links

stable

global.Pear API class

stable

Changelog parsing and diffing

stable

Shared Pear constants

stable

Command parser & definitions

stable

Shared Pear error types

stable

Shared builtins, overrides & linker mappings

unstable

Interprocess Communication library

stable

IO handle reference counter & tracker

stable

Runtime Information state bootstrap for API building

stable

Shared state structure & capabilities

stable

Terminal User Interface library

stable

Used with pear-ipc, tries to boot sidecar on connect failure

stable

P2P Modules

Modules that supply point-to-point peer-to-peer connection and storage capabilities.

Building-Block Libraries

The essential building-blocks for building powerful P2P applications using Pear.

Name
Description
Systems
Stability

A distributed, secure append-only log for creating fast, scalable P2P applications

stable

An append-only B-tree running on a Hypercore. Allows sorted iteration and more

stable

A secure, real-time, efficient distributed P2P file-system

stable

A "virtual Hypercore" layer over many Hypercores owned by many different peers

stable

The Distributed Hash Table (DHT) powering Hyperswarm

stable

A high-level API for finding and connecting to peers by topic

stable

Helper Libraries

Helper modules can be used together with the building-blocks to create cutting-edge P2P tools and application-modules.

Name
Description
Systems
Stability

A Hypercore factory that simplifiest managing Hypercore collections

stable

A file system interoperable with Hyperdrive

stable

Mirror between a Hyperdrive and/or Localdrive

stable

Securely create connections between peers in a Hyperswarm

stable

Binary encoding schemes for efficient parser-serializers.

stable

Multiplex multiple message oriented protocols over a stream

stable

Bare Modules

Pear's native runtime is Bare. The Bare global API is minimal and not intended as a standard library. Standard runtime functionality is provided via a installable modules. prefixed with bare-.

Module
Description
Systems
Stability

Cause abnormal program termination and generate a crash report

stable

Parse and produce ANSI escape sequences

stable

Assertion library for JavaScript

stable

Native synchronization primitives for JavaScript

stable

Native buffers for JavaScript

stable

Application bundle format for JavaScript

stable

Inter-thread messaging for JavaScript

stable

WHATWG debugging console for JavaScript

stable

Cryptographic primitives for JavaScript

stable

Create and manage daemon processes in JavaScript

stable

Native UDP for JavaScript

stable

Domain name resolution for JavaScript

stable

WHATWG text encoding interfaces for JavaScript

stable

Environment variable support for JavaScript

stable

Event emitters for JavaScript

stable

WHATWG Fetch implementation for Bare

stable

Form data support for Bare

stable

String formatting for JavaScript

stable

Native file system for JavaScript

stable

High-resolution timers for JavaScript

stable

HTTP/1 library for JavaScript

stable

HTTPS library for JavaScript

stable

Inspect objects as strings for debugging

stable

V8 inspector support for Bare

stable

Lightweight pipe-based IPC for Bare

stable

Low-level logger for Bare with system log integration

stable

Module support for JavaScript

stable

Operating system utilities for JavaScript

stable

Bundle packing for Bare

stable

Path manipulation library for JavaScript

stable

Performance monitoring for Bare

stable

Native I/O pipes for JavaScript

stable

Microtask queuing for Bare

stable

Line editing for interactive CLIs with command history

stable

Realm support for Bare

stable

Read-Evaluate-Print-Loop environment for JavaScript

stable

https://github.com/holepunchto/librpc ABI compatible RPC for Bare

stable

Minimal semantic versioning library for Bare

stable

Native signal handling for JavaScript

stable

Streaming data for JavaScript

stable

Structured cloning algorithm for JavaScript

stable

Native process spawning for JavaScript

stable

Native TCP sockets for JavaScript

stable

Native timers for JavaScript

stable

Transport Layer Security (TLS) streams for JavaScript

stable

Native TTY streams for JavaScript

stable

Cross-realm type predicates for Bare

stable

Bundle unpacking for Bare

stable

WHATWG URL implementation for JavaScript

stable

Higher-level worker threads for JavaScript

stable

WebSocket library for JavaScript

stable

Stream-based zlib bindings for JavaScript

stable

Low-level ZeroMQ bindings for JavaScript

stable

Compatibility modules for Node.js builtins in Bare can be found in bare-node.

Tools

Beyond the Pear CLI these ecosystem P2P CLI tools are additionally useful for day-to-day development and operations.

Name
Description
Systems
Stability

A CLI to create and connect to P2P E2E encrypted shells

stable

A swiss-knife proxy powered by hyperdht

stable

A one-to-one and end-to-end encrypted internet pipe

stable

A CLI to run SSH over the DHT.

stable

CLI that interacts with hyperdrive & localdrive

stable

Last updated