usage.txt 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. Usage: wait-on {OPTIONS} resource [...resource]
  2. Description:
  3. wait-on is a command line utility which will wait for files, ports,
  4. sockets, and http(s) resources to become available (or not available
  5. using reverse flag). Exits with success code (0) when all resources
  6. are ready. Non-zero exit code if interrupted or timed out.
  7. Options may also be specified in a config file (js or json). For
  8. example --config configFile.js would result in configFile.js being
  9. required and the resulting object will be merged with any
  10. command line options before wait-on is called. See exampleConfig.js
  11. In shell combine with && to conditionally run another command
  12. once resources are available. ex: wait-on f1 && NEXT_CMD
  13. resources types are defined by their prefix, if no prefix is
  14. present, the resource is assumed to be of type 'file'
  15. resource prefixes are:
  16. file: - regular file (also default type). ex: file:/path/to/file
  17. http: - HTTP HEAD returns 2XX response. ex: http://m.com:90/foo
  18. https: - HTTPS HEAD returns 2XX response. ex: https://my/bar
  19. http-get: - HTTP GET returns 2XX response. ex: http-get://m.com:90/foo
  20. https-get: - HTTPS GET returns 2XX response. ex: https-get://my/bar
  21. tcp: - TCP port is listening. ex: tcp:1.2.3.4:9000 or tcp:foo.com:700
  22. socket: - Domain Socket is listening. ex: socket:/path/to/sock
  23. For http over socket, use http://unix:SOCK_PATH:URL_PATH
  24. like http://unix:/path/to/sock:/foo/bar or
  25. http-get://unix:/path/to/sock:/foo/bar
  26. Standard Options:
  27. -c, --config
  28. js or json config file, useful for http(s) options
  29. -d, --delay
  30. Initial delay before checking for resources in ms, default 0
  31. --httpTimeout
  32. Maximum time in ms to wait for an HTTP HEAD/GET request, default 0
  33. which results in using the OS default
  34. -i, --interval
  35. Interval to poll resources in ms, default 250ms
  36. -l, --log
  37. Log resources begin waited on and when complete or errored
  38. -r, --reverse
  39. Reverse operation, wait for resources to NOT be available
  40. -s, --simultaneous
  41. Simultaneous / Concurrent connections to a resource, default Infinity
  42. Setting this to 1 would delay new requests until previous one has completed.
  43. Used to limit the number of connections attempted to a resource at a time.
  44. -t, --timeout
  45. Maximum time in ms to wait before exiting with failure (1) code,
  46. default Infinity
  47. Use postfix 'ms', 's', 'm' or 'h' to change the unit.
  48. --tcpTimeout
  49. Maximum time in ms for tcp connect, default 300ms
  50. Use postfix 'ms', 's', 'm' or 'h' to change the unit.
  51. --httpTimeout
  52. Maximum time to wait for the HTTP request, default Infinity
  53. Use postfix 'ms', 's', 'm' or 'h' to change the unit.
  54. -v, --verbose
  55. Enable debug output to stdout
  56. -w, --window
  57. Stability window, the time in ms defining the window of time that
  58. resource needs to have not changed (file size/availability) before
  59. signaling success, default 750ms. If less than interval, it will be
  60. reset to the value of interval. This is only used for files, other
  61. resources are considered available on first detection.
  62. -h, --help
  63. Show this message