UNPKG

cloudcms-cli

Version:
35 lines (31 loc) 915 B
var helper = require("../../../helper"); var AbstractCommand = require("../../abstract"); class ServerLatencyCommand extends AbstractCommand { constructor() { super({ "group": "latency", "name": "server", "description": "Tests latency to any HTTP server", "schema": { "properties": [{ "name": "url", "type": "string", "description": "Enter the URL to execute against:", "required": true, "args": ["url", "u"], "default": "https://api.cloudcms.com" }] } }); } handle(options, callback) { // call workhorse function helper.testLatency(options.url, function(err) { callback(err); }); } } module.exports = ServerLatencyCommand;