{"id":20505400,"url":"https://github.com/kenigbolo/network-speed","last_synced_at":"2025-04-09T08:10:20.950Z","repository":{"id":26876345,"uuid":"111521045","full_name":"kenigbolo/network-speed","owner":"kenigbolo","description":"Node light weight module to check network speed (upload/download)","archived":false,"fork":false,"pushed_at":"2023-03-04T03:08:00.000Z","size":759,"stargazers_count":81,"open_issues_count":19,"forks_count":33,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T02:40:42.707Z","etag":null,"topics":["hacktoberfest","internet","internet-speed","internet-speed-checker","speedtest"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kenigbolo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-21T08:31:42.000Z","updated_at":"2024-12-20T05:05:25.000Z","dependencies_parsed_at":"2024-06-18T15:13:24.728Z","dependency_job_id":"3ab1ffa6-52f2-481d-b597-599d765291e4","html_url":"https://github.com/kenigbolo/network-speed","commit_stats":{"total_commits":104,"total_committers":9,"mean_commits":"11.555555555555555","dds":0.5288461538461539,"last_synced_commit":"f5dc03bcb462ef6785e04403f1a95fcb0974a1bf"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenigbolo%2Fnetwork-speed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenigbolo%2Fnetwork-speed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenigbolo%2Fnetwork-speed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenigbolo%2Fnetwork-speed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kenigbolo","download_url":"https://codeload.github.com/kenigbolo/network-speed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247999861,"owners_count":21031046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","internet","internet-speed","internet-speed-checker","speedtest"],"created_at":"2024-11-15T19:46:39.670Z","updated_at":"2025-04-09T08:10:20.929Z","avatar_url":"https://github.com/kenigbolo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DEVELOPERS GUIDE\n\n[![Build Status](https://travis-ci.org/kenigbolo/network-speed.png)](https://travis-ci.org/kenigbolo/network-speed)\n\n## Getting Started\n\n- Clone the application with\n  `git clone https://github.com/kenigbolo/network-speed.git` or use ssh\n  `git clone git@github.com:kenigbolo/network-speed.git`.\n\n## Dependencies\n\n- NPM 6.6\n\n## Description\n\nBasic Javascript Module used to check upload and download speed. Contributions\nare welcome.\n\n## NPM\n\nThis package has been published on\n[NPM](https://www.npmjs.com/package/network-speed) and is freely available\naccording to the MIT license. To install via npm simply run\n`npm install network-speed`.\n\n## Functionality\n\nThe library exposes two functions\n\n* checkDownloadSpeed\n* checkUploadSpeed\n\n### checkDownloadSpeed\n\nThe checkDownloadSpeed accepts two arguments:\n\n1. The `baseUrl` - This refers to the url where the file is to be dowloaded from. This field is required to be of type `String`\n2. 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`.\n\n\u003e The return value is an object which contains the download speed representation in `bits/second(bps)`, `kolibits/second(kbs)` and `megabits/second (mbs)`.\n\n### checkUploadSpeed\n\nThe 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\n\n1. The `options` argument - This refers to the needed arguments in making a http request in node. The signature is as follows\n2. 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`.\n\n```\nconst options = {\n  // The hostname where the request would be made\n  hostname: 'https://your-domain-name',\n  // The port of the host\n  port: 80,\n  // The endpoint available for uploading the data stream\n  path: '/speed-checker-upload',\n  // The http methos\n  method: 'POST',\n  headers: {\n    // Format being used. Currently we just send a json file stream\n    'Content-Type': 'application/json',\n  },\n};\n```\n\n\u003e 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\n\n## Usage\n\n```javascript\nimport NetworkSpeed from 'network-speed'; // ES6\nconst NetworkSpeed = require('network-speed');  // ES5\nconst testNetworkSpeed = new NetworkSpeed();\n\ngetNetworkDownloadSpeed();\n\nasync function getNetworkDownloadSpeed() {\n  const baseUrl = 'https://eu.httpbin.org/stream-bytes/500000';\n  const fileSizeInBytes = 500000;\n  const speed = await testNetworkSpeed.checkDownloadSpeed(baseUrl, fileSizeInBytes);\n  console.log(speed);\n}\n\ngetNetworkUploadSpeed();\n\nasync function getNetworkUploadSpeed() {\n  const options = {\n    hostname: 'www.google.com',\n    port: 80,\n    path: '/catchers/544b09b4599c1d0200000289',\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n    },\n  };\n  const fileSizeInBytes = 2000000\n  const speed = await testNetworkSpeed.checkUploadSpeed(options, fileSizeInBytes);\n  console.log(speed);\n}\n```\n\n## StandAlone\n\nrunning `npm start` will trigger the test usage file to run and calculate your\nupload/download speed using some test servers `See the test usage file`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenigbolo%2Fnetwork-speed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkenigbolo%2Fnetwork-speed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenigbolo%2Fnetwork-speed/lists"}