Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple-url-speedtest

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-url-speedtest - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

2

package.json
{
"name": "simple-url-speedtest",
"version": "0.1.4",
"version": "0.1.5",
"description": "",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -40,13 +40,22 @@ # simple-url-speedtest

/**
* 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) => {
/**
* Data response will be in this format
* {
* url: string
* ping: number //in milliseconds
* }
*/
console.log(data)
});
// or using Promise callback method
SpeedTest(urlList).then(data => {
console.log(data)
});
```

@@ -19,7 +19,9 @@ const calculateSpeed = (url) => {

export default (urlArr, callback) => {
const testQueue = urlArr.map((url) => calculateSpeed(url));
Promise.all(testQueue).then((data) => {
callback(data);
});
if (callback) {
Promise.all(urlArr.map(calculateSpeed)).then((data) => {
callback(data);
});
} else {
return Promise.all(urlArr.map(calculateSpeed));
}
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc