Iback
This CLI tool notifies you when your internet connection speed is back to normal, so you can kick back instead of watching Chrome's dinosaur while clicking F5.
Installation
npm i -g iback
Usage
iback
Options
--help Display this help
--min-download=<speed>, -d=<speed> Set the minimum download speed in Mbps to pass the test
default: 0.01
--min-upload=<speed>, -u=<speed> Set the minimum upload speed in Mbps to pass the test
default: 0.01
--max-ping=<ms>, -p=<ms> Set the maximum ping to pass the test
default: 5000
--silent, -s Don't send notifications
--stiky-notifications, -sn Make all notifications wait
--no-sounds, -ns Stop the notification sounds
--log-errors, -le Log errors
--error-retry-time=<seconds>, -ert=<seconds> Set the time to wait before retrying when an error occurs
default: 60
--no-error-retry, -ner Don't retry when an error occurs
--log-failures, -lf Log failures (Slow Internet)
--failure-retry-time=<seconds>, -frt=<seconds> Set the time to wait before retrying when the Internet is slow
default: 0
--no-failure-retry, -nfr Don't retry when the Internet is slow
--max-time=<ms>, -mt Set the maximum length of a single test run (upload or download)
default: 5000
Examples
iback --min-download=0.5 --log-failures
API
Iback can be extended or built on:
npm i -S iback
const Iback = ; const iback = minDownload: 3 ; iback; iback;
Options
Iback receives an options object can be like this:
const options = test: maxTime: 5000 // original speedtest-net settings, see (https://github.com/ddsol/speedtest.net) retryOnError: 60 // time to retry after error, or false to disable autoretry on errors retryOnFailure: 0 // time to retry after failure, or false to disable autoretry on errors minDownload: 001 // minimum accepted download speed in Mbps minUpload: 001 // minimum accepted upload speed in Mbps maxPing: 5000 // maximum accepted ping speed in ms ...options;const iback = options;
Events
testing
Fired when testing the connection starts.
iback;
iback
Fired when test finishes and the internet connection meets the specified requirements in options.
Callback receives an object conains the following:
- download: the download speed.
- upload: the upload speed.
- ping: ping to the testing server.
- result: original speedtest-net result.
iback;
failure
Fired when test finishes and the internet connection doesn't meet the specified requirements in options.
Callback receives an object conains the following:
- download: the download speed.
- upload: the upload speed.
- ping: ping to the testing server.
- result: original speedtest-net result.
iback;
error
Fired when an error occur and the test couldn't be finished.
Callback receives error string.
iback;
result
Fired when test finishes.
Callback receives an object conains the following:
- result: original speedtest-net result.
iback;
retryingafter
Fired each second while waiting for a retry.
Callback receives the number of remaining seconds before next retry.
iback;
retrying
Fired just before starting the test again.
iback;
Troubleshooting
If the notifications don't work please see node-notifier.