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 🙏

© 2024 – Pkg Stats / Ryan Hefner

accurizer

v1.0.3

Published

Accurizer.js is a small Node.js library that does simple functions and parameters to predict loading time of any source.

Downloads

4

Readme

Accurizer.js

A simple Node.js package that can predict the loading time of downloading, uploading, bulk-loading, network speed, and page loading speed.

What is it?

Do you wish you could get an accurate time predictor for when something is done loading/downloading? We can do that for you!

Its name is based off of the accuracy of the predictor, Accurizer.

Quick start

Installing

To install it, simply run:

$ npm install accurizer

To install as a dependency:

$ npm install accurizer --save

Integration

Now, you will need to require it in your script:

const Accurizer = require("accurizer");

That's it! Now you can use it.

Example

This example will predict the loading time of a page on the clients' computer.

const Accurizer = require("accurizer");

Accurizer("page", 1, {
  url: "https://example.com"
}).then(prediction => console.log(prediction));

// 1.2 seconds

Arguments

Accurizer(_function: String[page | download | load | network | multi], _example: Number | Float, _options: {})
  • _function: A string (page | download | load | network | multi) that describes what to do

  • _example: A number representing how long the time usually takes (for a 1GB download file, try 67 seconds)

  • _options: An object with available options listed below:

    • url: A full URL of a website. This argument works with page | download | multi
    • sources: An array of URLs for multiple loading times. This argument works with load | multi
    • average: A boolean telling whether to use an average loading time. This argument works with download | multi
    • functions: An array of _function options to do multiple functions at once. This argument works with multi

Promise handling

Once Accurizer predicts a loading time, you will need to get it using .then() from a Promise function.

Accurizer(...).then(prediction => /* Use the time (in seconds) */)

More examples

Predict how long a page takes to load

Accurizer("page", 1, {
  url: "https://example.com"
}).then(prediction => console.log(prediction));

Predict the download speed of a download file

Accurizer("download", 2.5, {
  url: "https://example.com/mydownloadfile.dmg"
}).then(prediction => console.log(prediction));

Predict a more accurate download speed of a download file

Accurizer("download", 2, {
  url: "https://example.com/mydownloadfile.dmg",
  average: true
}).then(prediction => console.log(prediction));

Predict the loading speed sum of multiple URLs

Accurizer("load", 4, {
  sources: ["https://example.com", "https://npmjs.com", "https://stackoverflow.com"]
}).then(prediction => console.log(prediction));

Predict how long your network takes to download a 10MB file

Accurizer("network", 1).then(prediction => console.log(prediction));

Link multiple functions and get the total time:

Accurizer("multi", 5, {
  functions: ["download", "load", "network"]
  url: "https://example.com/mydownloadfile.dmg",
  sources: ["https://example.com", "https://npmjs.com", "https://stackoverflow.com"]
}).then(prediction => console.log(prediction));

Using CDN

This package works on client-side JavaScript, but it has a few more functions using it like that.

Embed the script tag in your page:

<script src="https://cdn.jsdelivr.net/gh/Parking-Master/Accurizer.js@latest/accurizer.js">

Or use the minified version:

<script src="https://cdn.jsdelivr.net/gh/Parking-Master/Accurizer.js@latest/accurizer.min.js">

License

MIT

Copyright (c) 2021-2023 Parking Master