1.0.4 • Published 4 years ago
speedtest-service v1.0.4
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 speedtestDebian/Ubuntu:
sudo apt-get install curl
curl -s https://install.speedtest.net/app/cli/install.deb.sh | sudo bash
sudo apt-get install speedtestFedora/RedHat/CentOS:
curl -s https://install.speedtest.net/app/cli/install.rpm.sh | sudo bash
sudo yum install speedtestModule
Install with NPM
npm install --save speedtest-serviceInstall with Yarn
yarn add speedtest-serviceExample 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 git@github.com:dewhurstwill/speedtest-service.git
$ cd speedtest-service
$ npm run install-cliUninstall the CLI
$ git clone git@github.com:dewhurstwill/speedtest-service.git
$ cd speedtest-service
$ npm run uninstall-cliUsing the CLI
$ speedtest-cli --help
Usage:
speedtest-cli run [--debug -d -D] [--help -h -H]
or
speedtest-cli help
$ speedtest-cli run