← All Tools

CLI filter that emits lines from stdin or file with optional delay, enabling controlled flow through data processing pipelines.

Why popstr?

Sometimes you need to control the rate at which data flows through a pipeline. Whether you're rate-limiting API requests, replaying logs at a realistic pace, or testing how your system handles steady input streams, popstr gives you precise control over line-by-line output timing.

Memory Efficient

Streams line-by-line, handling arbitrarily large files without loading them into memory.

Unix Philosophy

Works as a filter in pipelines. Reads from stdin or files, writes to stdout. Composes naturally with other tools.

Flexible Timing

Add consistent delays, random jitter, or batch multiple lines together. Fine-tune output timing to match your needs.

Install

On macOS with Homebrew:

brew tap uradical/tap
brew install popstr

Or install with Go:

go install uradical.io/go/popstr@latest

Usage

popstr
popstr [flags] [file]

Flags

flags
-d, --delayInterval between line outputs (default: 0s)
-n, --batchLines to emit simultaneously (default: 1)
-j, --jitterRandom variation range on delay (default: 0s)
-h, --helpShow help

Examples

Rate-limit API requests

Send one request per second:

rate limiting
popstr -d 1s urls.txt | xargs curl

Batch processing

Emit 10 lines every 5 seconds:

batch processing
popstr -d 5s -n 10 large-file.txt | process-batch

Randomised delays

Add jitter to avoid thundering herd:

jitter
popstr -d 2s -j 500ms urls.txt | xargs curl

Log replay

Replay production logs at a controlled pace:

log replay
popstr -d 10ms production.log | ./processor

From clipboard

Process clipboard contents line by line:

clipboard
pbpaste | popstr -d 500ms | xargs curl