4.6.0 • Published 4 years ago

responsetimejs v4.6.0

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

responsetimejs npm version changelog

An npm package which gets the response time for a website on different servers using puppeteer and bitcatcha website.

Addendum:

Note that this program opens a headless chrome web page to manually get the website responsetime, so depending on your connection speed this can last a few seconds. Also from the release v4.5.7 there has been a major update (fix of error returning wrong response time and two new servers) you can check it out here -> changelog.

Installation

With node.js:

npm install responsetimejs

With yarn:

yarn add responsetimejs

How to use?

Example usage:

const res = require("responsetimejs");

const myRequest = new res("https://www.google.com");
//or a more complete instantiation
const myRequest = new res({
  url: "https://www.google.com",
  server: "uk",
  msg: false,
  num: false
});

myRequest.get().then(result => {
  console.log(result); //example log: ['104ms','A+']
});

Docs:

Properties:

propertytypedefault valuedescription
url[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type)nullurl of the website to send the request to.
server[string](https://developer.mozilla.org/en-US/docs/)ukselects which server to send the request from.
msg[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)falsewhether to display a custom message in the console after receiving the data.
num[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)falsewhether to return the time as a number in milliseconds 104 or as a string 104ms.

Available Servers (use the keywords):

  • use(US east)
  • usw(US west)
  • uk(London)
  • sg(Singapore)
  • br(Sao Paulo)
  • in(Bangalore)
  • au(Sydney)
  • jp(Japan)
  • ca(Toronto)
  • de(Germany)

Methods:

How does it work?

You can read more of the process behind the scenes here How it works.

Credits

Made with ❤ by AlexSimpler. 2020

4.6.0

4 years ago

4.5.8

4 years ago

4.5.7

4 years ago

4.5.6

4 years ago

4.5.4

4 years ago

4.5.3

4 years ago

4.5.2

4 years ago

4.5.1

4 years ago

4.5.0

4 years ago

4.2.0

4 years ago

4.1.0

4 years ago

2.3.0

4 years ago

4.0.0

4 years ago

3.0.0

4 years ago

2.0.0

4 years ago