npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

shout-run-sdk

v0.3.0

Published

TypeScript SDK for shout.run - broadcast your terminal from code

Readme

TypeScript SDK for shout.run. Broadcast your terminal from code.

Write a script, pipe some output, and anyone with the link watches it live.

Install

npm install @shout/sdk

Quick Start

import { ShoutSession } from '@shout/sdk';

const session = new ShoutSession({
  apiKey: 'shout_sk_...',
  title: 'My Agent Session',
});

const info = await session.start();
console.log(`Live at: ${info.url}`);

session.write('Hello, world!\r\n');
// ... do work ...

await session.end();

Getting an API Key

npm install -g shout-run
shout login
shout api-key create "My Agent"

The key is printed once. Save it somewhere safe. Keys start with shout_sk_.

You can list your keys with shout api-key list and revoke one with shout api-key revoke <id>.

API Reference

new ShoutSession(options)

| Option | Type | Default | Description | |--------|------|---------|-------------| | apiKey | string | required | API key (starts with shout_sk_) | | title | string | 'SDK Session' | Session title shown to viewers | | visibility | 'public' \| 'followers' \| 'private' | 'public' | Who can see the session | | cols | number | 80 | Terminal columns | | rows | number | 24 | Terminal rows | | apiUrl | string | 'https://api.shout.run' | API base URL |

Methods

  • start() — Creates the session and connects WebSocket. Returns { sessionId, url, wsUrl }.
  • write(data: string | Buffer) — Sends terminal output. Automatically buffered, rate-limited, and chunked.
  • resize(cols, rows) — Updates terminal dimensions.
  • end() — Flushes buffer, sends end frame, closes session.

Properties

  • state — Current state: 'idle' | 'connecting' | 'live' | 'ending' | 'ended'
  • viewers — Current viewer count
  • id — Session ID (null before start)

Events

session.on('connected', () => { /* WebSocket connected */ });
session.on('disconnected', (code, reason) => { /* connection lost */ });
session.on('reconnecting', (attempt) => { /* reconnecting... */ });
session.on('viewers', (count) => { /* viewer count updated */ });
session.on('error', (error) => { /* error occurred */ });
session.on('stateChange', (state) => { /* state changed */ });

Piping Process Output

import { ShoutSession } from '@shout/sdk';
import { spawn } from 'node:child_process';

const session = new ShoutSession({
  apiKey: process.env.SHOUT_API_KEY!,
  title: 'Running tests',
});

await session.start();

const child = spawn('npm', ['test'], { shell: true });

child.stdout.on('data', (data) => session.write(data));
child.stderr.on('data', (data) => session.write(data));

child.on('close', async () => {
  await session.end();
});

Search and Content API

Search existing sessions and read their transcripts.

ShoutSession.searchSessions(apiKey, query, options?)

Search for sessions by query string, tags, and status.

const results = await ShoutSession.searchSessions(apiKey, 'typescript', {
  tags: ['tutorial', 'demo'],
  status: 'ended',
  limit: 10,
});

for (const session of results) {
  console.log(`${session.title} by ${session.username}`);
}

Options:

| Option | Type | Description | |--------|------|-------------| | tags | string[] | Filter by tags (any match) | | status | 'live' \| 'ended' | Filter by session status | | limit | number | Max results (1-50, default: 20) | | cursor | string | Cursor for pagination | | apiUrl | string | API base URL override |

ShoutSession.getSessionContent(apiKey, sessionId, options?)

Get session metadata and plain-text transcript.

const content = await ShoutSession.getSessionContent(apiKey, 'abc123xyz');
console.log(`Title: ${content.session.title}`);
console.log(`Transcript: ${content.transcript.slice(0, 200)}...`);

Options:

| Option | Type | Description | |--------|------|-------------| | apiUrl | string | API base URL override |

License

MIT