npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

speed-testjs

v1.0.35

Published

measure internet bandwidth

Downloads

284

Readme

SpeedtestJS

Speed-testJS is a JavaScript based speed test that will provide users with an enriched view of their Internet speed. Providing users with not only their latency, upload and download speeds and context around their entire Internet experience. Using speed tier data to add a qualifying metric to standard speed test results users will now know whether their experience is poor, good or great

Deployment

For deploying to a test server, see the README under ansible folder.

Client Server Setup

The application consists of a node/express software running the server and plain javascript/html on the client. The server powers reset endpoints, websocket communication, database interactions and the client website.

Server

Index.js is the starting point of the app contains of the neccessary functions to run the application. Significant settings in this file are:

  • IP address and ports: the server will automatically bind to the ipv4 and ipv6 addresses of the host machine that it is deployed to (ie. app.listen(SERVERPORT,'::');). Addtionaly ports can be assigned with app.listen(ADDITIONALPORT);

  • Http Request: http configuration is defined to allow http posts and cross domain request.

  • WebSockets: websockets communication is defined

  • REST endpoints: rest endpoints are exposed to complete a speed test and include the following:

    1. testplan: testplan will return json data containing the ipv4, ipv6 ipaddresses and ports used for rest endPoints and websockets running on the server and the client ipAddress. Also additional speed test features(ie. latency based routing flags can be returned)
    2. latency: returns simple pong message
    3. download: binary data based on request
    4. upload: accepts post for uploads
    5. downloadProbe: returns recommended download bandwidth testing size based on request
    6. calculator: returns calculations based on request array giving statistics on datum.
    7. testServer: used in latency based routing.. it will return test servers urls that can be used to find the closet server to a client
  • Configuration: Generic configuration (ports, latencyBasedRouting,...) are set in index.js. Specific customization(ie. database) can be place under the config folder

  1. Configuration parameters
  2. Rest Endpoints
  3. WebSockets
  4. Modules folder contains custom modules used for the application.

Client

Client: Client application resides in the public folder and consists of plain javascript. Index.html is the default start page of the application and will contain an end to end example of a Bandwidth Speed Test. The following describes the folder structure of the client application:

  • lib: The lib folder contains javascript files used to measure bandwidth and related measurements.
  • example: The example folder contains html files used to test the measurement javascript files in the lib folder
    1. Base xmlhttprequest and websocket objects
    2. Different test suites using the base Base xmlhttprequest and websocket objects
  • test: test folder contains unit tests
  • uilib: javascript files specific to UI.
  • img: images for testing or ui

Manual deployment

Grunt is being used to package the needed files and folders to deploy the application to a server to run the application. The steps are listed below:

  1. run grunt package from the root folder
  2. tar, zip or compress the resulting dist folder
  3. deploy and uncompress on your server
  4. execute node index.js from the console.

Running the application

To run the application locally

  1. Clone repo
  2. run npm install from root folder
  3. run node index.js
  4. browse to the ipaddress:port number (ie. locally it will be http://localhost:port

Database

To set dynamodb locally

  1. Follow the instructions in the link to download and run dynamodb locally http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html
  2. Set up AWS credentially locally http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/setup-credentials.html
  3. Once dynamodb is set up locally. Use the following to script to create a table and insert the data into the dynamodb (execute node database.js from terminal)
  4. While executing the script change table name and server information