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

pi-speedtest

v0.1.2

Published

Check ISP speeds using a Raspberry Pi

Downloads

3

Readme

Pi Speedtest

Use this module to regularly measure your internet speed using your Raspberry Pi (or any other suitable Linux device).

This module was devised to be run on a Raspberry Pi, but because it's a Node module, you can run it on any system that supports node. If you do use a Raspberry Pi, it's strongly suggested to connect it to your internet modem using a cable, and to not use the Wifi. Wifi can sometimes be dodgy for reasons beyond the influence of your ISP, but when you use a cable, you can be pretty sure the speed you measure is the best speed your internet connection can provide.

Getting started

Before you start using this module, please go to https://app.pi-speedtest.net and sign up using your GitHub account. For now, only GitHub is supported for logging in, but we reckon most people who fiddle around with Raspberry Pi's have a GitHub account.

When you first log in, you need to create an Access Token that will identify you when you start using this module. On the Account page, click on "What is this?" in the Authentication section (no token will be shown at this stage). Click on the button that says "Regenerate" and a token will be created for you. You can copy the entire string using the "Copy" button (it's the button with the clipboard on it) and store it on your Raspberry Pi:

$ joe ~/.st/config

(or use your own favourite editor). Your file should look something like this:

token 5f598b0a6717ac43df0d13340ac943a4fcd3992c28f435421d6fd442c6fd448b

Next, you need to install the command at. This is a utility that allows for scheduling commands at a certain time. This module uses at to schedule the next measurement. If you are using a Debian based distribution on your Pi, you should be able to install at like so:

$ sudo apt install at

and follow the prompt that may occur.

You are now ready to start measuring your internet speed.

Install this module:

$ npm install -g pi-speedtest

This will install the module globally. You can run using using the command pi-speedtest.

Next steps

You can run a single test using this command:

$ pi-speedtest test -V

The flag -V means "verbose". Omitting it will turn the module silent.

This test will test the connection to our backend, and will only run if the connection works (meaning you are using a valid token).

After running the test, the results will be shown in the console. If you go to the site and refresh the data, you should see the results there too.

Now, you can start continuously measuring your internet connection speed:

$ pi-speedtest start

(Use -V to see its output.)

This will set up a recurring call to the module in order to measure the speed. At any time you can check that a measurement is scheduled by running the command atq. Measurements occur at slightly random times, but on average six times a day, or once every four hours or so. You can use the option -r to run an immediate test in addition to starting scheduled testing.

You can stop continuous measurements by running this command:

$ pi-speedtest stop

(Use -V to see its output.)

The recurring call will now be removed. Please note that you can run a manual test at any time using the command:

$ pi-speedtest test -V

If you'd rather not run 6 measurements a day, you can also install a cron job to run, for instance, daily. That will greatly reduce the amount of data used for speed testing.

Disclaimer

This module is a work in progress. It comes without any implied warranty. It uses the module "speedtest-net" to do the actual measurement.