All Projects → kenigbolo → network-speed

kenigbolo / network-speed

Licence: MIT license
Node light weight module to check network speed (upload/download)

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to network-speed

speedtest
A self-hosted, lightweight HTML5 speed test implemented in JavaScript, based on Web Workers and XMLHttpRequest.
Stars: ✭ 154 (+123.19%)
Mutual labels:  speedtest, internet-speed
speed-cloudflare-cli
📈 Measure the speed and consistency of your internet connection using speed.cloudflare.com
Stars: ✭ 99 (+43.48%)
Mutual labels:  internet, speedtest
internet-speed-testing
Library for measure your internet speed. [for android app]
Stars: ✭ 40 (-42.03%)
Mutual labels:  internet, speedtest
HowSlow
A Service Worker that monitors network requests to estimate bandwidth and RTT
Stars: ✭ 38 (-44.93%)
Mutual labels:  speedtest
Windows-to-Android-Internet-with-USB-Cable-Reverse-tethering-setup-for-Windows
One click windows to android internet connection (Opposite of Android USB Tethering)
Stars: ✭ 34 (-50.72%)
Mutual labels:  internet
pocketinternet
A Pocket Internet for teaching how the Internet really works.
Stars: ✭ 28 (-59.42%)
Mutual labels:  internet
Webicity
Webicity: The perpetually unfinished web browser. The Ribbon branch is the last working version. The Thready branch is the current work on a complete rewrite.
Stars: ✭ 24 (-65.22%)
Mutual labels:  internet
Podcast Cli
Podcast CLI player
Stars: ✭ 228 (+230.43%)
Mutual labels:  internet
Node
MASQ combines the benefits of VPN and Tor technology to create a superior next-generation privacy software, where users are rewarded for supporting an uncensored global web. Users gain privacy and anonymity online, while helping promote Internet Freedom.
Stars: ✭ 123 (+78.26%)
Mutual labels:  internet
tcping
tcping command, written with Objective-C, on macOS,tcping for mac,ping over a tcp connection
Stars: ✭ 219 (+217.39%)
Mutual labels:  speedtest
foxpages
Visual FoxPro Multithread Web Server
Stars: ✭ 22 (-68.12%)
Mutual labels:  internet
ez-net-app
EZ Net is an application developed for rural internet users which are not tech savy and shows interest in the internet and the resources it has.
Stars: ✭ 16 (-76.81%)
Mutual labels:  internet
GetJSON
GetJson is the simplest HTTP library to Receive JSON Data from REST Service.
Stars: ✭ 18 (-73.91%)
Mutual labels:  internet-speed-checker
Knock
🔑 Scan the entire internet for SSH and Telnet services. Then hack them.
Stars: ✭ 60 (-13.04%)
Mutual labels:  internet
hldig
hl://Dig is a fork of ht://Dig, a web indexing and searching system for a small domain or intranet
Stars: ✭ 17 (-75.36%)
Mutual labels:  internet
Is Reachable
Check if servers are reachable
Stars: ✭ 249 (+260.87%)
Mutual labels:  internet
docker-speedtest-influxdb
Speedtest results to InfluxDB for Grafana
Stars: ✭ 20 (-71.01%)
Mutual labels:  speedtest
fast-speedtest-api
fast.com API / CLI tool
Stars: ✭ 138 (+100%)
Mutual labels:  speedtest
direct-net-share
share internet via Wifi direct on Android
Stars: ✭ 36 (-47.83%)
Mutual labels:  internet
speedtest-exporter
Speedtest Exporter made in python using the official speedtest bin
Stars: ✭ 118 (+71.01%)
Mutual labels:  speedtest

DEVELOPERS GUIDE

Build Status

Getting Started

  • Clone the application with git clone https://github.com/kenigbolo/network-speed.git or use ssh git clone [email protected]:kenigbolo/network-speed.git.

Dependencies

  • NPM 6.6

Description

Basic Javascript Module used to check upload and download speed. Contributions are welcome.

NPM

This package has been published on NPM and is freely available according to the MIT license. To install via npm simply run npm install network-speed.

Functionality

The library exposes two functions

  • checkDownloadSpeed
  • checkUploadSpeed

checkDownloadSpeed

The checkDownloadSpeed accepts two arguments:

  1. The baseUrl - This refers to the url where the file is to be dowloaded from. This field is required to be of type String
  2. The fileSizeInBytes - This refers to the size of the file to be downloaded. The file size is required to be of type Number and should always be in Bytes.

The return value is an object which contains the download speed representation in bits/second(bps), kolibits/second(kbs) and megabits/second (mbs).

checkUploadSpeed

The checkUploadSpeed sends a randomly generated 20 kilobytes data stream to a given server endpoint and uses that to calculate the speed. It accepts only one argument in the form of a JavaScipt object

  1. The options argument - This refers to the needed arguments in making a http request in node. The signature is as follows
  2. The fileSizeInBytes - This refers to the size of the file to be uploaded. The file size is required to be of type Number and should always be in Bytes.
const options = {
  // The hostname where the request would be made
  hostname: 'https://your-domain-name',
  // The port of the host
  port: 80,
  // The endpoint available for uploading the data stream
  path: '/speed-checker-upload',
  // The http methos
  method: 'POST',
  headers: {
    // Format being used. Currently we just send a json file stream
    'Content-Type': 'application/json',
  },
};

PS - For optimal results please use your own predefined endpoints defined on your sever for checking the speed as the servers used in this project are simply test servers and could be taken down anytime. Always use the https protocol

Usage

import NetworkSpeed from 'network-speed'; // ES6
const NetworkSpeed = require('network-speed');  // ES5
const testNetworkSpeed = new NetworkSpeed();

getNetworkDownloadSpeed();

async function getNetworkDownloadSpeed() {
  const baseUrl = 'https://eu.httpbin.org/stream-bytes/500000';
  const fileSizeInBytes = 500000;
  const speed = await testNetworkSpeed.checkDownloadSpeed(baseUrl, fileSizeInBytes);
  console.log(speed);
}

getNetworkUploadSpeed();

async function getNetworkUploadSpeed() {
  const options = {
    hostname: 'www.google.com',
    port: 80,
    path: '/catchers/544b09b4599c1d0200000289',
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
  };
  const fileSizeInBytes = 2000000
  const speed = await testNetworkSpeed.checkUploadSpeed(options, fileSizeInBytes);
  console.log(speed);
}

StandAlone

running npm start will trigger the test usage file to run and calculate your upload/download speed using some test servers See the test usage file

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].