@honem/teletext-core
v1.0.0
Published
Provider-agnostic teletext fetcher, cache, and topic API. Powers @honem/teletext-mcp and @honem/teletext-cli.
Downloads
68
Maintainers
Readme
@honem/teletext-core
The boring-but-important brains behind @honem/teletext-mcp and @honem/teletext-cli.
A provider-agnostic teletext library: fetch a broadcaster's snapshot, cache it for a minute, then ask it for pages, topics, indexes, or full-text matches. Zero runtime dependencies — just plain Node ESM.
Install
npm install @honem/teletext-coreUse it
import { makeProviderApi, getProvider } from "@honem/teletext-core";
const api = makeProviderApi(getProvider("ct")); // or "svt"
await api.getPage("100"); // master index, plain text
await api.getPage("170", "B"); // page 170, subpage B
await api.getTopic("weather"); // all weather pages, concatenated
await api.search("počasí"); // substring hits with snippets
await api.getIndex(); // parsed topic → page-number map
await api.refresh(); // bust the 60s cacheCurrently shipped providers
| Code | Broadcaster | Country | Language |
|-------|--------------------------|---------|----------|
| ct | Česká televize | CZ | cs |
| svt | Sveriges Television Text | SE | sv |
getAllProviders() lists them. filterProviders("sweden") does the obvious thing.
Adding your own broadcaster
Implement the Provider interface from providers/types.ts, plug it into the registry, and the MCP server + CLI pick it up automatically. See the main README for the four-step recipe.
License
MIT.
