speedtest-service
v1.0.4
Published
A simple speedtest CLI and package that leverages the Speedtest.net CLI tool.
Downloads
44
Readme
Speedtest Service
A simple speedtest CLI and package that leverages the Speedtest.net CLI tool.
Prequesties
Ensure that speedtest is installed. Available here.
Mac OS:
brew tap teamookla/speedtest
brew update
brew install speedtest
Debian/Ubuntu:
sudo apt-get install curl
curl -s https://install.speedtest.net/app/cli/install.deb.sh | sudo bash
sudo apt-get install speedtest
Fedora/RedHat/CentOS:
curl -s https://install.speedtest.net/app/cli/install.rpm.sh | sudo bash
sudo yum install speedtest
Module
Install with NPM
npm install --save speedtest-service
Install with Yarn
yarn add speedtest-service
Example usage
const speedtest = require('speedtest-service');
const result = speedtest();
console.log(result);
Example output
{
server: {
org: 'YouFibre',
location: 'Manchester',
id: '48475'
},
isp: 'Hyperoptic Ltd',
latency: '2.05 ms',
download: '195.15 Mbps',
upload: '368.53 Mbps',
packetLoss: 'Not available.',
resultUrl: 'https://www.speedtest.net/result/c/2b753g91-24h5-67aa-111g-7g999a9a99aa'
}
CLI
Install the CLI
$ git clone [email protected]:dewhurstwill/speedtest-service.git
$ cd speedtest-service
$ npm run install-cli
Uninstall the CLI
$ git clone [email protected]:dewhurstwill/speedtest-service.git
$ cd speedtest-service
$ npm run uninstall-cli
Using the CLI
$ speedtest-cli --help
Usage:
speedtest-cli run [--debug -d -D] [--help -h -H]
or
speedtest-cli help
$ speedtest-cli run