jeffbski / wait-on

wait-on is a cross-platform command line utility and Node.js API which will wait for files, ports, sockets, and http(s) resources to become available
MIT License
1.87k stars 77 forks source link

Support waiting on multiple ports #129

Open paulsmithkc opened 1 year ago

paulsmithkc commented 1 year ago

Currently wait-on only allows for you to wait until one or more known services have started.

However the specific port that the service will be running on, isn't always known in advance, so I would like the ability to wait on a set of ports instead of a single port.

Example: Wait on port 7071 OR 7072.

wait-on tcp:7071,7072

Example: Wait on a port in the range 7071-7080

wait-on tcp:7071-7080
metcoder95 commented 1 year ago

Sure, it is not the same, but currently you can achieve the same passing each one of them as a single resource, or that doesn't work?

paulsmithkc commented 1 year ago

@metcoder95 When I pass multiple resources, it waits for ALL of them to become available, not just one of them.

metcoder95 commented 1 year ago

That will be interesting, maybe worth it to explore an option like —single to just succeed when the first resource becomes avaialble

paulsmithkc commented 1 year ago

That will be interesting, maybe worth it to explore an option like —single to just succeed when the first resource becomes avaialble

Or --first

sinedied commented 1 year ago

That would also works as a workaround for https://github.com/jeffbski/wait-on/issues/133 if we could have this not just for ports, but full host/port combos!