Comparing version 3.2.0 to 3.3.0-beta.0
@@ -44,2 +44,7 @@ Usage: wait-on {OPTIONS} resource [...resource] | ||
--httpTimeout | ||
Maximum time in ms to wait for an HTTP HEAD/GET request, default 0 | ||
which results in using the OS default | ||
-i, --interval | ||
@@ -46,0 +51,0 @@ |
@@ -17,2 +17,3 @@ 'use strict'; | ||
delay: Joi.number().integer().min(0).default(0), | ||
httpTimeout: Joi.number().integer().min(0), | ||
interval: Joi.number().integer().min(0).default(250), | ||
@@ -53,9 +54,9 @@ log: Joi.boolean().default(false), | ||
Resource types are distinquished by their prefix with default being `file:` | ||
- file:/path/to/file - waits for file to be available and size to stabilize | ||
- http://foo.com:8000/bar verifies HTTP HEAD request returns 2XX | ||
- https://my.bar.com/cat verifies HTTPS HEAD request returns 2XX | ||
- http-get: - HTTP GET returns 2XX response. ex: http://m.com:90/foo | ||
- https-get: - HTTPS GET returns 2XX response. ex: https://my/bar | ||
- tcp:my.server.com:3000 verifies a service is listening on port | ||
- socket:/path/sock verifies a service is listening on (UDS) socket | ||
- file:/path/to/file - waits for file to be available and size to stabilize | ||
- http://foo.com:8000/bar verifies HTTP HEAD request returns 2XX | ||
- https://my.bar.com/cat verifies HTTPS HEAD request returns 2XX | ||
- http-get: - HTTP GET returns 2XX response. ex: http://m.com:90/foo | ||
- https-get: - HTTPS GET returns 2XX response. ex: https://my/bar | ||
- tcp:my.server.com:3000 verifies a service is listening on port | ||
- socket:/path/sock verifies a service is listening on (UDS) socket | ||
@@ -65,4 +66,6 @@ @param opts object configuring waitOn | ||
@param opts.delay integer - optional initial delay in ms, default 0 | ||
@param opts.httpTimeout integer - optional http HEAD/GET timeout to wait for request, default 0 | ||
@param opts.interval integer - optional poll resource interval in ms, default 250ms | ||
@param opts.log boolean - optional flag to turn on logging to stdout | ||
@param opts.tcpTimeout - Maximum time in ms for tcp connect, default 300ms | ||
@param opts.timeout integer - optional timeout in ms, default Infinity. Aborts with error. | ||
@@ -72,3 +75,3 @@ @param opts.verbose boolean - optional flag to turn on debug output | ||
@param cb optional callback function with signature cb(err) - if err is provided then, resource checks did not succeed | ||
if not specified, wait-on will return a promise that will be rejected if resource checks did not succeed or resolved otherwise | ||
if not specified, wait-on will return a promise that will be rejected if resource checks did not succeed or resolved otherwise | ||
*/ | ||
@@ -219,3 +222,4 @@ function waitOn(opts, cb) { | ||
// https://github.com/request/request/tree/c289759d10ebd76ff4138e81b39c81badde6e274#tlsssl-protocol | ||
'cert', 'key', 'passphrase', 'ca' | ||
'cert', 'key', 'passphrase', 'ca', | ||
'httpTimeout' // needs to be renamed timeout for use with request | ||
]; | ||
@@ -226,3 +230,8 @@ | ||
if (options[validOpt] !== undefined) { | ||
parsed[validOpt] = options[validOpt]; | ||
// for httpTimeout, need to use timeout as request param | ||
if (validOpt === 'httpTimeout') { | ||
parsed['timeout'] = options['httpTimeout']; | ||
} else { // all other options match their keys for request | ||
parsed[validOpt] = options[validOpt]; | ||
} | ||
} | ||
@@ -229,0 +238,0 @@ }); |
{ | ||
"name": "wait-on", | ||
"description": "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", | ||
"version": "3.2.0", | ||
"version": "3.3.0-beta.0", | ||
"main": "lib/wait-on", | ||
@@ -6,0 +6,0 @@ "bin": { |
@@ -15,3 +15,3 @@ # wait-on - wait for files, ports, sockets, http(s) resources | ||
Latest version 3 requires Node.js v6+ | ||
Latest version 3 requires Node.js v8.9+ | ||
@@ -97,4 +97,9 @@ (Node.js v4 users can still use wait-on@2.1.2, and older Node.js | ||
-i, --interval | ||
--httpTimeout | ||
Maximum time in ms to wait for an HTTP HEAD/GET request, default 0 | ||
which results in using the OS default | ||
-i, --interval | ||
Interval to poll resources in ms, default 250ms | ||
@@ -101,0 +106,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28456
337
259
2