Skip to content

Commit

Permalink
Extend String.prototype for colors
Browse files Browse the repository at this point in the history
  • Loading branch information
Ta1al committed Aug 10, 2022
1 parent 82697f2 commit c4d1720
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import ping from 'ping';
import fetch from 'node-fetch';
import logUpdate from 'log-update';
import color from 'colors';
import 'colors';
const url = 'https://steamcdn-a.akamaihd.net/apps/sdr/network_config.json';

(async function () {
logUpdate(color.yellow('Fetching Servers'));
logUpdate('Fetching Servers'.yellow);
const servers = await fetchServers();
logUpdate(color.green(`Fetched ${servers.length} Servers`));
logUpdate(`Fetched ${servers.length} Servers`.green);
logUpdate.done();
for (const server of servers) {
logUpdate(color.green('Pinging'), color.bgWhite(server.name));
logUpdate('Pinging'.green, `${server.name}`.bgWhite);
let ping = await pingServer(server.relays[ 0 ]);
if (ping === 'unknown') { logUpdate(color.red(`${server.name} did not respond`)) }
else { logUpdate(color.bold(`${server.name}`), color.italic(`${ping}ms`)); }
if (ping === 'unknown') { logUpdate(`${server.name} did not respond`.red) }
else { logUpdate(`${server.name}`.bold, `${ping}ms`.italic); }
logUpdate.done();
}
})();
Expand Down

0 comments on commit c4d1720

Please sign in to comment.