npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

iback

v1.1.0

Published

Notifies you when your Internet speed is back to normal

Downloads

3

Readme

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.

iback - failed and retrying iback - success

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 } = require("iback");

const iback = new Iback({ minDownload: 3 });

iback.on("iback", sendSMS);

iback.on("error", logError);

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: 0.01, // minimum accepted download speed in Mbps
    minUpload: 0.01, // minimum accepted upload speed in Mbps
    maxPing: 5000, // maximum accepted ping speed in ms
    ...options
};
const iback = new Iback(options);

Events

testing

Fired when testing the connection starts.

iback.on("testing", cb);

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.on("iback", ({ download, upload, ping, result }) => {
    console.dir({ download, upload, ping });
});

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.on("failure", ({ download, upload, ping, result }) => {
    console.dir({ download, upload, ping });
});

error

Fired when an error occur and the test couldn't be finished.

Callback receives error string.

iback.on("error", err => {
    console.error(err);
});

result

Fired when test finishes.

Callback receives an object conains the following:

iback.on("result", result => {
    console.dir(result);
});

retryingafter

Fired each second while waiting for a retry.

Callback receives the number of remaining seconds before next retry.

iback.on("retryingafter", secondsLeftToRetry => {
    console.dir(secondsLeftToRetry);
});

retrying

Fired just before starting the test again.

iback.on("retrying", () => console.log("retrying now"));

Troubleshooting

If the notifications don't work please see node-notifier.