mlab-speed-test
Version:
Test your download and upload speed using speed.measurementlab.net
4 lines • 1.1 kB
JavaScript
Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),commander_1=require("commander"),ink_1=require("ink"),ui_1=require("./ui"),react_1=tslib_1.__importDefault(require("react")),index_1=require("./index");process.stdin.resume(),process.on("SIGINT",function(){process.exit()});const program=new commander_1.Command;async function runSpeedTest(){const e={...program.opts()},t=new index_1.MLabSpeedTest,s=(0,ink_1.render)(react_1.default.createElement(ui_1.MLab,{speedTest:t,options:e}));e.acceptPrivacyPolicy&&e.autostart&&t.run(),await s.waitUntilExit()}async function run(){program.description(`Examples:
mlab-speed-test -a -p
mlab-speed-test -a -p --json`).option("-p, --accept-privacy-policy","Accept M-Lab's Privacy Policy (https://www.measurementlab.net/privacy/)",!1).option("-a, --autostart","Run speed test on command start. Requires --accept-privacy-policy",!1).option("--json","Output data in json format",!1).option("--pretty","If json should be pretty formatted",!1).action(runSpeedTest),await program.parseAsync()}run();
;