reading-streams

Provide readable streaming patterns and consumption APIs for durable streams in JavaScript/TypeScript clients.

1.7k|64|Updated Dec 4, 2025
One-click install
npx skills add https://github.com/durable-streams/durable-streams --skill reading-streams
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: reading-streams
Source: https://github.com/durable-streams/durable-streams/tree/main/packages/client/skills/reading-streams
Command: npx skills add https://github.com/durable-streams/durable-streams --skill reading-streams

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a robust set of reading patterns for durable streams, enabling client applications to fetch, stream, and process data from the Durable Streams service with flexibility across catch-up and live modes.

Core Features & Use Cases

  • Readable consumption via stream() for both catch-up and live scenarios.
  • Multiple consumption methods: .json(), .text(), .body(), .jsonStream(), .textStream(), .bodyStream(), and .subscribeJson(), .subscribeText(), .subscribeBytes().
  • Supports various live modes (false, true, "long-poll", "sse"), offset management, and error recovery to handle interruptions gracefully.

Quick Start

Start by importing the Durable Streams client and calling stream with a stream URL, an offset (for example "-1"), and a live mode to begin consuming data.

Frequently Asked Questions about reading-streams

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I read durable streams with live streaming and catch-up modes in JavaScript?

Durable stream reading supports live modes including true, false, long-poll, and SSE. You select a mode by passing the desired parameter to the stream method, which determines whether the client catches up on historical data first or maintains a continuous real-time connection.

How do I consume JSON and text data from a real-time streaming API?

Stream consumption methods like .json(), .text(), and .body() handle different data formats, while .subscribeJson(), .subscribeText(), and .subscribeBytes() provide continuous event listening. Choose based on whether you need one-time reads, streaming chunks, or persistent subscriptions.

What is the best way to track offsets and recover from errors during real-time stream processing?

Offset tracking and error handling hooks allow you to manage your position in the stream and recover from interruptions gracefully. By specifying an offset like -1, the client resumes reading from a known checkpoint, ensuring no data is lost during failures.

Does durable stream reading work with SSE and long-polling for real-time client applications?

Yes, durable stream reading supports both Server-Sent Events (SSE) and long-polling as live modes. These options allow client applications to receive real-time updates efficiently, falling back to long-polling when continuous SSE connections are not supported or practical.

Can I process byte streams from a durable stream in a TypeScript application?

Yes, you can process byte streams using the .body(), .bodyStream(), and .subscribeBytes() methods. These APIs provide raw byte access for binary data processing, allowing TypeScript applications to handle non-text payloads directly from the durable stream.

When do I need checkpoint-based processing for streaming JSON data?

Checkpoint-based processing is needed when your application must guarantee data delivery across interruptions or restarts. By tracking offsets, you ensure the client resumes streaming JSON data from the exact last-processed position rather than missing events or duplicating work.