https://github.com/orlin/on-up
calls back on up or after time is up
https://github.com/orlin/on-up
Last synced: 2 months ago
JSON representation
calls back on up or after time is up
- Host: GitHub
- URL: https://github.com/orlin/on-up
- Owner: orlin
- Created: 2014-12-12T16:58:32.000Z (over 10 years ago)
- Default Branch: active
- Last Pushed: 2014-12-19T17:49:53.000Z (over 10 years ago)
- Last Synced: 2025-03-02T05:42:12.983Z (3 months ago)
- Language: JavaScript
- Size: 152 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# on-up
[](https://www.npmjs.org/package/on-up)
Calls back on up or after time is up.
## Why
When doing Continuous Integration, for example with [Travis](https://travis-ci.org/),
one has to guess how long a server will take to start,
sleep more than necessary and hope it's enough.No longer necessary.
## How
Waits for a server to come up with a rsponse to a request.
A callback is invoked with the response and / or metadata.
There is a timeout and various other configuration settings.## Use
See [wait-up](https://github.com/orlin/wait-up) for simple command-line use.
The [`bin.js`](https://github.com/orlin/wait-up/blob/active/bin.js) example
of how I use the library. Usually, it provides everything necessary.### Options
In case you want more, here are the defaults to override:
```coffee
req:
uri: "/" #localhost port 80 prepended if / is the first char
timeout: 1000 # how long request will wait before timing-out / repeat
spacings: 240 # time in-between retries
patience: 42000 # the ultimate patience (i.e. max duration wait)
dots: false # true allows side-effects (i.e. write dots to stdout)
```See [request options](https://github.com/request/request#requestoptions-callback).
for what `req` takes. Of-course, the numbers are in milliseconds.## License
[MIT](http://orlin.mit-license.org)