À propos du projet
tcp-ping is a promise-based TypeScript utility for checking whether a TCP host is reachable and measuring connection latency. It exposes a ping function that performs multiple sequential connection attempts and returns a result object including average, minimum, and maximum latency, along with any per-attempt errors. Users can configure the target address or hostname, port, number of attempts, and timeout, with sensible defaults such as localhost, port 80, 10 attempts, and a 3-second timeout. A progress callback can report each completed attempt, which is useful for monitoring long-running checks. The package also provides a probe function for a single reachability test that returns a boolean. Because attempts are not concurrent, unreachable hosts with many attempts can take a long time to resolve. Negative port values produce an error. The project is published as an npm package, includes tests, and is licensed under MIT.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.