fast-api-remake

0.3.4 • Public • Published

fast.com logo

fast.com API / CLI tool

Build Status NPM version Node version GitHub license

A speed test powered by fast.com
From scratch, with no dependencies

Installation

$ npm install --save fast-speedtest-api

Command-Line Tool

$ npm install --global fast-speedtest-api
$ fast-speedtest --help
    fast-speedtest - speed test powered by fast.com
    usage: fast-speedtest token [-v, --verbose] [-r, --raw] [-n, --no-https] [-t, --timeout timeout] [-c, --count url-count] [-b, --buffer buffer-size] [-u, --unit output-unit]

Api usage

Example:

const FastSpeedtest = require("fast-speedtest-api");

let speedtest = new FastSpeedtest({
    token: "your-app-token", // required
    verbose: false, // default: false
    timeout: 10000, // default: 5000
    https: true, // default: true
    urlCount: 5, // default: 5
    bufferSize: 8, // default: 8
    unit: FastSpeedtest.UNITS.Mbps, // default: Bps
    proxy: 'http://optional:auth@my-proxy:123' // default: undefined
});

speedtest.getSpeed().then(s => {
    console.log(`Speed: ${s} Mbps`);
}).catch(e => {
    console.error(e.message);
});

FAQ

How to get app token ?

Go on fast.com, open your browser devtools, go on Network tab and copy the token on the request url that looks like https://api.fast.com/netflix/speedtest?https=true&token=<the-token>&urlCount=5

TODO

  • Better verbose mode
  • Add tests

Feel free to contribute

Package Sidebar

Install

npm i fast-api-remake

Weekly Downloads

2

Version

0.3.4

License

GPL-3.0

Unpacked Size

51.4 kB

Total Files

10

Last publish

Collaborators

  • manhnk