Emit lines from stdin or file with optional delay. A simple Unix-style filter for controlling pipeline flow.
go install uradical.io/go/popstr@latestpopstr [flags] [file]
Flags:
-d, --delay delay between lines (default: 0s)
-n, --batch number of lines to emit at a time (default: 1)
-j, --jitter random variation on delay, e.g. 2s means ±2s (default: 0s)
-h, --help show help
-v, --version show version
Basic rate limiting:
popstr -d 1s urls.txt | xargs curlBatch 10 lines at a time with 5 second gaps:
popstr -d 5s -n 10 large-file.txt | process-batchAPI calls with jitter to avoid thundering herd:
popstr -d 2s -j 500ms urls.txt | xargs curlReplay logs at a controlled pace:
popstr -d 10ms production.log | ./my-streaming-processorWorks with stdin:
pbpaste | popstr -d 500ms | xargs curl- Zero delay by default (acts as a line buffer)
- Streams line-by-line, handles arbitrarily large files
- Passes empty lines through unchanged
- Exits cleanly on SIGINT/SIGPIPE
- No dependencies beyond Go stdlib
MIT