Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jeffbski/wait-on
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v7.0.1
Choose a base ref
...
head repository: jeffbski/wait-on
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.1.0
Choose a head ref
  • 16 commits
  • 7 files changed
  • 5 contributors

Commits on Mar 9, 2021

  1. Verified

    This commit was signed with the committer’s verified signature.
    junderw Jonathan Underwood
    Copy the full SHA
    e724137 View commit details

Commits on Jan 7, 2023

  1. Bump json5 from 1.0.1 to 1.0.2

    Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
    - [Release notes](https://github.com/json5/json5/releases)
    - [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
    - [Commits](json5/json5@v1.0.1...v1.0.2)
    
    ---
    updated-dependencies:
    - dependency-name: json5
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Jan 7, 2023
    Copy the full SHA
    46f0c63 View commit details

Commits on Feb 10, 2023

  1. Copy the full SHA
    d9b7515 View commit details

Commits on Apr 3, 2023

  1. Copy the full SHA
    ef2fad3 View commit details

Commits on Nov 2, 2023

  1. Merge pull request #138 from CodingSpiderFox/patch-1

    use correct property names
    jeffbski authored Nov 2, 2023
    Copy the full SHA
    ac707b8 View commit details
  2. Merge pull request #135 from bnussman/upgrade-joi-to-latest-version

    Update `joi` to `17.7.1` and update `package-lock.json` for CVE-2023-25166
    jeffbski authored Nov 2, 2023
    Copy the full SHA
    6ebecc0 View commit details
  3. Merge pull request #132 from jeffbski/dependabot/npm_and_yarn/json5-1…

    ….0.2
    
    Bump json5 from 1.0.1 to 1.0.2
    jeffbski authored Nov 2, 2023
    Copy the full SHA
    c830235 View commit details
  4. Copy the full SHA
    84e667f View commit details

Commits on Nov 3, 2023

  1. add to README about timeout, tcpTimeout, httpTimeout allowing unit

    If no unit it specified defaults to ms.
    
    Allows units: ms,s,m,h
    jeffbski committed Nov 3, 2023
    Copy the full SHA
    5dab987 View commit details
  2. add additional unit tests

    jeffbski committed Nov 3, 2023
    Copy the full SHA
    3caa77c View commit details
  3. Copy the full SHA
    b9ec579 View commit details
  4. patch and minor dep updates

    jeffbski committed Nov 3, 2023
    Copy the full SHA
    f4c99ae View commit details
  5. major dep updates

    jeffbski committed Nov 3, 2023
    Copy the full SHA
    18a9b6c View commit details
  6. Merge pull request #144 from jeffbski/update-deps-2023-11-02

    Update deps 2023 11 02
    jeffbski authored Nov 3, 2023
    Copy the full SHA
    96b0e33 View commit details
  7. update semver

    jeffbski committed Nov 3, 2023
    Copy the full SHA
    0ec371e View commit details
  8. 7.1.0

    jeffbski committed Nov 3, 2023
    Copy the full SHA
    aefc49e View commit details
Showing with 879 additions and 913 deletions.
  1. +8 −1 README.md
  2. +7 −0 bin/usage.txt
  3. +22 −2 bin/wait-on
  4. +2 −2 exampleConfig.js
  5. +771 −898 package-lock.json
  6. +9 −9 package.json
  7. +60 −1 test/cli.mocha.js
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -121,10 +121,17 @@ Standard Options:
Maximum time in ms to wait before exiting with failure (1) code,
default Infinity
Use postfix 'ms', 's', 'm' or 'h' to change the unit.
--tcpTimeout
Maximum time in ms for tcp connect, default 300ms
Maximum time in ms for tcp connect, default 300ms
Use postfix 'ms', 's', 'm' or 'h' to change the unit.
--httpTimeout
Maximum time to wait for the HTTP request, default Infinity
Use postfix 'ms', 's', 'm' or 'h' to change the unit.
-v, --verbose
7 changes: 7 additions & 0 deletions bin/usage.txt
Original file line number Diff line number Diff line change
@@ -68,10 +68,17 @@ Standard Options:

Maximum time in ms to wait before exiting with failure (1) code,
default Infinity
Use postfix 'ms', 's', 'm' or 'h' to change the unit.

--tcpTimeout

Maximum time in ms for tcp connect, default 300ms
Use postfix 'ms', 's', 'm' or 'h' to change the unit.

--httpTimeout

Maximum time to wait for the HTTP request, default Infinity
Use postfix 'ms', 's', 'm' or 'h' to change the unit.

-v, --verbose

24 changes: 22 additions & 2 deletions bin/wait-on
Original file line number Diff line number Diff line change
@@ -5,8 +5,9 @@ const minimist = require('minimist');
const path = require('path');
const waitOn = require('../');

const interval = ['timeout', 'httpTimeout', 'tcpTimeout'];
const minimistOpts = {
string: ['c', 'd', 'i', 's', 't', 'w', 'httpTimeout', 'tcpTimeout'],
string: ['c', 'd', 'i', 's', 't', 'w'].concat(interval),
boolean: ['h', 'l', 'r', 'v'],
alias: {
c: 'config',
@@ -55,7 +56,11 @@ if (argv.help || !hasResources) {
'window'
].reduce(function (accum, x) {
if (argv[x]) {
accum[x] = argv[x];
let value = argv[x];
if (interval.includes(x)) {
value = parseInterval(value);
}
accum[x] = value;
}
return accum;
}, configOpts);
@@ -79,3 +84,18 @@ function errorExit(err) {
}
process.exit(1);
}

function parseInterval(arg) {
const res = /^([\d.]+)(|ms|s|m|h)$/i.exec(arg);
if (!res) {
return arg;
}
const value = parseFloat(res[1]);
switch (res[2]) {
case '':
case 'ms': return Math.floor(value);
case 's': return Math.floor(value * 1000);
case 'm': return Math.floor(value * 1000 * 60);
case 'h': return Math.floor(value * 1000 * 60 * 60);
}
}
4 changes: 2 additions & 2 deletions exampleConfig.js
Original file line number Diff line number Diff line change
@@ -12,8 +12,8 @@ module.exports = {
],
passphrase: 'yourpassphrase',
auth: {
user: 'yourusername',
pass: 'yourpassword'
username: 'yourusername',
password: 'yourpassword'
},
strictSSL: false,
followRedirect: false,
Loading