{"repo":"vercel/bidc","free":true,"listed":false,"github":"https://github.com/vercel/bidc","clone":"git clone https://github.com/vercel/bidc.git","description":"Bidirectional Channels for JavaScript","language":"TypeScript","stars":1277,"topics":["async","channels","iframe","javascript","messaging","rpc","worker"],"license":null,"category":"chat-messaging","readme_excerpt":"BIDC - Bidirectional Channels for JavaScript A bidirectional channel library for asynchronous communication support across JavaScript contexts. Overview Unlike traditional postMessage APIs, BIDC enables seamless communication between different JavaScript execution contexts (workers, iframes, service workers) with full support for complex data types, with Promises and Async Functions , via a custom streaming protocol. BIDC automatically establishes a channel between the current context and the target context, regardless of which side initiates first. It also handles re-establishing connections if one side is reloaded (e.g., an iframe) and buffers messages until the other side is ready to receive them. Features - Automatic Handshake : Robust connection establishment with collision resolution - Complex Data Types : Seamlessly transfer Dates, RegExp, Maps, Sets, ArrayBuffers, TypedArrays, and more - Asynchronous : Promises and Async Functions remain as first-class citizens during transfer - Concurrent Operations : Handle multiple simultaneous messages without blocking - TypeScript : Easy to infer types for the RPC-style method calls Examples - Basic Data Transfer - Two-Way Communication - Complex Data Types - Advanced Use Cases: Nested Promises - Advanced Use Cases: Remote Callbacks - Advanced Use Cases: Worker Communication - Advanced Use Cases: Namespaced Channels Installation Examples Basic Data Transfer BIDC automatically establishes a channel between the current context and ","default_branch":null,"files":null,"tree":[],"storefront":"/r/vercel","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/vercel/bidc/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}