$ show jeffbski/wait-on
wait-on is a cross-platform CLI tool and Node.js library that polls various resource types (files, TCP ports, Unix domain sockets, HTTP/HTTPS endpoints) until they become available (or unavailable in reverse mode). It uses RxJS observables for reactive polling with configurable delay, interval, stability window, timeout, and simultaneous connection limits. The library supports both callback and promise APIs. The codebase demonstrates solid engineering: input validation via Joi, functional utilities from lodash, HTTP requests via axios with TLS/proxy/auth support, and comprehensive test coverage (API and CLI). It is a well-maintained, production-ready utility commonly used in CI/CD pipelines and development workflows to synchronize service startup.
The LLM identified 1 files worth highlighting for reuse:
The core library module implementing resource polling using RxJS. It defines resource-type-specific observable factories (createFileResource$, createHTTP$, createTCP$, createSocket$) that are combined with combineLatest and controlled via timer, mergeMap, scan, and distinctUntilChanged operators. The Joi validation schema provides robust option validation with defaults. This pattern of creating an observable per resource and merging them is clean and reusable for any polling-based wait logic.