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 Barearrow-up-right, 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

Image
Image
Image

stable

Send inter-app pattern-matched object messages

Image
Image
Image

stable

Receive object messages that match a given object pattern

Image
Image
Image

stable

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

Image
Image
Image

stable

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

Image
Image
Image

stable

Receive platform and application update notifications

Image
Image
Image

stable

Get the path of user-specific directories

Image
Image
Image

stable

Receive wakeup events, including link clicks external to app

Image
Image
Image

stable

User Interface Libraries

Pear modules that supply User Interface runtime capabilities.

Module
Description
Systems
Stability

Pear User-Interface Library for Electron

Image
Image
Image

stable

Local HTTP bridge for pear-electron applications

Image
Image
Image

stable

Common Libraries

Pear modules for general usage, including applications per case.

Module
Description
Systems
Stability

Drop data, including application reset

Image
Image
Image

stable

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

Image
Image
Image

stable

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

Image
Image
Image

stable

Read Pear project information by link

Image
Image
Image

stable

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

Image
Image
Image
Image
Image

stable

Pear operation stream promise wrapper

Image
Image
Image

stable

Set application production release version length

Image
Image
Image

stable

Seed or reseed a Pear app drive by link

Image
Image
Image

stable

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

Image
Image
Image

stable

Interleave locals into a template, sync and stream

Image
Image
Image

stable

Developer Libraries

Pear modules to assist with developing & debugging

Module
Description
Systems
Stability

Securely enable remote debugging protocol over Hyperswarm

Image
Image
Image
Image
Image

stable

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

Image
Image
Image

stable

Integration Libraries

Pear modules for runtime integrations. Such as pear-electronarrow-up-right.

Module
Description
Systems
Stability

Read-only Hyperdrive API subset interface for application drives

Image
Image
Image

stable

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

Image
Image
Image
Image
Image

stable

global.Pear API class

Image
Image
Image
Image
Image

stable

Changelog parsing and diffing

Image
Image
Image
Image
Image

stable

Shared Pear constants

Image
Image
Image
Image
Image

stable

Command parser & definitions

Image
Image
Image

stable

Shared Pear error types

Image
Image
Image
Image
Image

stable

Shared builtins, overrides & linker mappings

Image
Image
Image

unstable

Interprocess Communication library

Image
Image
Image

stable

IO handle reference counter & tracker

Image
Image
Image
Image
Image

stable

Runtime Information state bootstrap for API building

Image
Image
Image
Image
Image

stable

Shared state structure & capabilities

Image
Image
Image
Image
Image

stable

Terminal User Interface library

Image
Image
Image

stable

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

Image
Image
Image

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

Image
Image
Image
Image
Image

stable

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

Image
Image
Image
Image
Image

stable

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

Image
Image
Image
Image
Image

stable

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

Image
Image
Image
Image
Image

stable

The Distributed Hash Table (DHT) powering Hyperswarm

Image
Image
Image
Image
Image

stable

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

Image
Image
Image
Image
Image

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 simplifies managing Hypercore collections

Image
Image
Image
Image
Image

stable

A file system interoperable with Hyperdrive

Image
Image
Image
Image
Image

stable

Mirror between a Hyperdrive and/or Localdrive

Image
Image
Image
Image
Image

stable

Securely create connections between peers in a Hyperswarm

Image
Image
Image
Image
Image

stable

Binary encoding schemes for efficient parser-serializers.

Image
Image
Image
Image
Image

stable

Multiplex multiple message oriented protocols over a stream

Image
Image
Image
Image
Image

stable

Bare Modules

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

Module
Description
Systems
Stability

Cause abnormal program termination and generate a crash report

Image
Image
Image
Image
Image

stable

Parse and produce ANSI escape sequences

Image
Image
Image
Image
Image

stable

Assertion library for JavaScript

Image
Image
Image
Image
Image

stable

Native synchronization primitives for JavaScript

Image
Image
Image
Image
Image

stable

Native buffers for JavaScript

Image
Image
Image
Image
Image

stable

Application bundle format for JavaScript

Image
Image
Image
Image
Image

stable

Inter-thread messaging for JavaScript

Image
Image
Image
Image
Image

stable

WHATWG debugging console for JavaScript

Image
Image
Image
Image
Image

stable

Cryptographic primitives for JavaScript

Image
Image
Image
Image
Image

stable

Create and manage daemon processes in JavaScript

Image
Image
Image

stable

Native UDP for JavaScript

Image
Image
Image
Image
Image

stable

Domain name resolution for JavaScript

Image
Image
Image
Image
Image

stable

WHATWG text encoding interfaces for JavaScript

Image
Image
Image
Image
Image

stable

Environment variable support for JavaScript

Image
Image
Image
Image
Image

stable

Event emitters for JavaScript

Image
Image
Image
Image
Image

stable

WHATWG Fetch implementation for Bare

Image
Image
Image
Image
Image

stable

Form data support for Bare

Image
Image
Image
Image
Image

stable

String formatting for JavaScript

Image
Image
Image
Image
Image

stable

Native file system for JavaScript

Image
Image
Image
Image
Image

stable

High-resolution timers for JavaScript

Image
Image
Image
Image
Image

stable

HTTP/1 library for JavaScript

Image
Image
Image
Image
Image

stable

HTTPS library for JavaScript

Image
Image
Image
Image
Image

stable

Inspect objects as strings for debugging

Image
Image
Image
Image
Image

stable

V8 inspector support for Bare

Image
Image
Image
Image
Image

stable

Lightweight pipe-based IPC for Bare

Image
Image
Image
Image
Image

stable

Low-level logger for Bare with system log integration

Image
Image
Image
Image
Image

stable

Module support for JavaScript

Image
Image
Image
Image
Image

stable

Operating system utilities for JavaScript

Image
Image
Image
Image
Image

stable

Bundle packing for Bare

Image
Image
Image
Image
Image

stable

Path manipulation library for JavaScript

Image
Image
Image
Image
Image

stable

Performance monitoring for Bare

Image
Image
Image
Image
Image

stable

Native I/O pipes for JavaScript

Image
Image
Image
Image
Image

stable

Microtask queuing for Bare

Image
Image
Image
Image
Image

stable

Line editing for interactive CLIs with command history

Image
Image
Image
Image
Image

stable

Realm support for Bare

Image
Image
Image
Image
Image

stable

Read-Evaluate-Print-Loop environment for JavaScript

Image
Image
Image
Image
Image

stable

Minimal semantic versioning library for Bare

Image
Image
Image
Image
Image

stable

Native signal handling for JavaScript

Image
Image
Image
Image
Image

stable

Streaming data for JavaScript

Image
Image
Image
Image
Image

stable

Structured cloning algorithm for JavaScript

Image
Image
Image
Image
Image

stable

Native process spawning for JavaScript

Image
Image
Image

stable

Native TCP sockets for JavaScript

Image
Image
Image
Image
Image

stable

Native timers for JavaScript

Image
Image
Image
Image
Image

stable

Transport Layer Security (TLS) streams for JavaScript

Image
Image
Image
Image
Image

stable

Native TTY streams for JavaScript

Image
Image
Image
Image
Image

stable

Cross-realm type predicates for Bare

Image
Image
Image
Image
Image

stable

Bundle unpacking for Bare

Image
Image
Image
Image
Image

stable

WHATWG URL implementation for JavaScript

Image
Image
Image
Image
Image

stable

Higher-level worker threads for JavaScript

Image
Image
Image
Image
Image

stable

WebSocket library for JavaScript

Image
Image
Image
Image
Image

stable

Stream-based zlib bindings for JavaScript

Image
Image
Image
Image
Image

stable

Low-level ZeroMQ bindings for JavaScript

Image
Image
Image
Image
Image

stable

Compatibility modules for Node.js builtins in Bare can be found in bare-nodearrow-up-right.

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

Image
Image
Image

stable

A swiss-knife proxy powered by hyperdht

Image
Image
Image

stable

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

Image
Image
Image

stable

A CLI to run SSH over the DHT.

Image
Image
Image

stable

CLI that interacts with hyperdrive & localdrive

Image
Image
Image

stable

Last updated