Skip to content

This package is to determine the speed of each url based on ping

Notifications You must be signed in to change notification settings

masonwongcs/simple-url-speedtest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-url-speedtest

A very simple url testing based on ping response

Table of Contents

Demo

Link to demo: https://simple-url-speedtest.surge.sh

Installation

npm i simple-url-speedtest --save

Usage

Import SpeedTest function into your Application

import SpeedTest from "simple-url-speedtest";

const urlList = [
  "https://www.facebook.com",
  "https://www.google.com",
  "https://www.apple.com",
  "https://www.cnn.com",
  "https://www.whatsapp.com",
  "https://www.yahoo.com",
  "https://www.samsung.com",
  "https://www.lg.com",
];

/**
 * Data arrays response will be in this format
 * 
 * {
 *    url: string
 *    ping: number // In milliseconds
 * }
 * 
*/

// Data can be access using function callback method
SpeedTest(urlList, (data) => {
  console.log(data)
});

// or using Promise callback method
SpeedTest(urlList).then(data => {
  console.log(data)
});

About

This package is to determine the speed of each url based on ping

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published