sindresorhus

wait-for-localhost

Wait for localhost to be ready

by sindresorhus

JavaScript

JavaScript95.5%
TypeScript4.5%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
71
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template
chrisguttandin

Right now runs a fixed number (6) of attempts over HTTP1 before switching to HTTP2. This causes it to fail to wait for an HTTP1 server which takes a little longer to be up and running. I think it would be better to alternate between HTTP1 and HTTP2 up until the server is running. Since the change is very simple I went ahead and turned it into a PR. Please feel free to edit or reject it if you think this doesn't make sense.

chrisguttandin · 5mo ago
SimonSiefke

fixes #19 This removes all event listeners on cleanup, so that the cleanup function is called once at most and no endless loop can occur.

SimonSiefke · 1y ago
SimonSiefke

I was confused for a bit why the program was hanging, but eventually profiling with vscode showed an endless loop in wait-for-localhost. Specifically, when the http2 client encounters an error like: then calls the function which calls , which results in the same error again which then calls the function again, and so on...

SimonSiefke · 1y ago
Structured data for AI agents

Repository: sindresorhus/wait-for-localhost. Description: Wait for localhost to be ready Stars: 279, Forks: 11. Primary language: JavaScript. Languages: JavaScript (95.5%), TypeScript (4.5%). License: MIT. Topics: delay, localhost, nodejs, npm-package, server, wait. Latest release: v5.0.2 (5mo ago). Open PRs: 0, open issues: 0. Last activity: 5mo ago. Community health: 71%. Top contributors: sindresorhus, BendingBender, bndnsmth, fehmer, chrisguttandin, danez, Richienb, SamVerschueren, SimonSiefke, vlad-zhukov.