Pear by Holepunch | Pears.com

5 min read Original article ↗

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

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

  • API - Application-Programming-Interface

  • CLI - Command-Line-Interface

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

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:

Unlikely to change or be removed in the foreseeable future

New, untested, or has known issues

Being removed or replaced in the future

May change or be removed without warning

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.

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

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

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

Pear modules related directly to application environment.

Uncaught exceptions & uncaught rejections crash logger

Send inter-app pattern-matched object messages

Receive object messages that match a given object pattern

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

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

Receive platform and application update notifications

Get the path of user-specific directories

Receive wakeup events, including link clicks external to app

Pear modules that supply User Interface runtime capabilities.

Pear User-Interface Library for Electron

Local HTTP bridge for pear-electron applications

Pear modules for general usage, including applications per case.

Drop data, including application reset

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

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

Read Pear project information by link

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

Pear operation stream promise wrapper

Set application production release version length

Seed or reseed a Pear app drive by link

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

Interleave locals into a template, sync and stream

Pear modules to assist with developing & debugging

Securely enable remote debugging protocol over Hyperswarm

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

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

Read-only Hyperdrive API subset interface for application drives

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

Changelog parsing and diffing

Command parser & definitions

Shared builtins, overrides & linker mappings

Interprocess Communication library

IO handle reference counter & tracker

Runtime Information state bootstrap for API building

Shared state structure & capabilities

Terminal User Interface library

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

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

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

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

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

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

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

The Distributed Hash Table (DHT) powering Hyperswarm

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

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

A Hypercore factory that simplifies managing Hypercore collections

A file system interoperable with Hyperdrive

Mirror between a Hyperdrive and/or Localdrive

Securely create connections between peers in a Hyperswarm

Binary encoding schemes for efficient parser-serializers.

Multiplex multiple message oriented protocols over a stream

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-.

Cause abnormal program termination and generate a crash report

Parse and produce ANSI escape sequences

Assertion library for JavaScript

Native synchronization primitives for JavaScript

Native buffers for JavaScript

Application bundle format for JavaScript

Inter-thread messaging for JavaScript

WHATWG debugging console for JavaScript

Cryptographic primitives for JavaScript

Create and manage daemon processes in JavaScript

Native UDP for JavaScript

Domain name resolution for JavaScript

WHATWG text encoding interfaces for JavaScript

Environment variable support for JavaScript

Event emitters for JavaScript

WHATWG Fetch implementation for Bare

Form data support for Bare

String formatting for JavaScript

Native file system for JavaScript

High-resolution timers for JavaScript

HTTP/1 library for JavaScript

HTTPS library for JavaScript

Inspect objects as strings for debugging

V8 inspector support for Bare

Lightweight pipe-based IPC for Bare

Low-level logger for Bare with system log integration

Module support for JavaScript

Operating system utilities for JavaScript

Path manipulation library for JavaScript

Performance monitoring for Bare

Native I/O pipes for JavaScript

Microtask queuing for Bare

Line editing for interactive CLIs with command history

Read-Evaluate-Print-Loop environment for JavaScript

Minimal semantic versioning library for Bare

Native signal handling for JavaScript

Streaming data for JavaScript

Structured cloning algorithm for JavaScript

Native process spawning for JavaScript

Native TCP sockets for JavaScript

Native timers for JavaScript

Transport Layer Security (TLS) streams for JavaScript

Native TTY streams for JavaScript

Cross-realm type predicates for Bare

Bundle unpacking for Bare

WHATWG URL implementation for JavaScript

Higher-level worker threads for JavaScript

WebSocket library for JavaScript

Stream-based zlib bindings for JavaScript

Low-level ZeroMQ bindings for JavaScript

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

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

A CLI to create and connect to P2P E2E encrypted shells

A swiss-knife proxy powered by hyperdht

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

A CLI to run SSH over the DHT.

CLI that interacts with hyperdrive & localdrive