makiwara 2.1.1 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # makiwara
2
2
 
3
+ [![node version](https://img.shields.io/node/v/makiwara.svg)](https://www.npmjs.com/package/makiwara)
3
4
  [![npm version](https://badge.fury.io/js/makiwara.svg)](https://badge.fury.io/js/makiwara)
4
- [![downloads count](https://img.shields.io/npm/dt/makiwara.svg)](https://www.npmjs.com/~piecioshka)
5
- [![travis](https://img.shields.io/travis/piecioshka/makiwara.svg)](https://travis-ci.org/piecioshka/makiwara)
6
- [![dependencies](https://david-dm.org/piecioshka/makiwara.svg)](https://github.com/piecioshka/makiwara)
7
- [![coveralls](https://coveralls.io/repos/github/piecioshka/makiwara/badge.svg?branch=master)](https://coveralls.io/github/piecioshka/makiwara?branch=master)
5
+ [![downloads count](https://img.shields.io/npm/dt/makiwara.svg)](https://www.npmjs.com/package/makiwara)
6
+ [![license](https://img.shields.io/npm/l/makiwara.svg)](https://www.npmjs.com/package/makiwara)
7
+ [![travis-ci](https://api.travis-ci.com/piecioshka/makiwara.svg?branch=master)](https://app.travis-ci.com/github/piecioshka/makiwara)
8
8
 
9
9
  :hammer: Benchmark URL to gain HTTP requests limits
10
10
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "makiwara",
3
3
  "description": "Benchmark URL to gain HTTP requests limits",
4
- "version": "2.1.1",
4
+ "version": "2.1.3",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "Piotr Kowalski",
@@ -12,13 +12,13 @@
12
12
  "clear": "rm -rf dist/ coverage/ .nyc_output/",
13
13
  "clear:all": "rm -rf node_modules/ && npm run clear",
14
14
  "test": "jasmine test/specs/*.js",
15
- "coverage": "nyc npm run test && nyc report --reporter=text-lcov | coveralls -v",
16
- "lint": "eslint .",
15
+ "coverage": "nyc npm run test && nyc report --reporter=html",
16
+ "lint": "eslint src/",
17
17
  "snyk-protect": "snyk protect",
18
18
  "prepare": "npm run snyk-protect"
19
19
  },
20
20
  "dependencies": {
21
- "@types/node": "^17.0.0",
21
+ "@types/node": "^17.0.8",
22
22
  "ansi-bold": "^0.1.1",
23
23
  "ansi-cyan": "^0.1.1",
24
24
  "ansi-gray": "^0.1.1",
@@ -26,20 +26,19 @@
26
26
  "ansi-yellow": "^0.1.1",
27
27
  "axios": "^0.24.0",
28
28
  "commander": "^8.3.0",
29
- "http-status-codes": "^2.1.4",
29
+ "http-status-codes": "^2.2.0",
30
30
  "is-url": "^1.2.4",
31
31
  "node-fetch": "^3.1.0",
32
32
  "ora": "^6.0.1",
33
- "snyk": "^1.797.0",
34
- "table": "^6.7.5"
33
+ "snyk": "^1.826.0",
34
+ "table": "^6.8.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@types/jasmine": "^3.10.2",
38
- "coveralls": "^3.1.1",
39
- "eslint": "^8.5.0",
37
+ "@types/jasmine": "^3.10.3",
38
+ "eslint": "^8.6.0",
40
39
  "eslint-config-piecioshka": "^2.0.4",
41
- "jasmine": "^3.10.0",
42
- "nock": "^13.2.1",
40
+ "jasmine": "^4.0.2",
41
+ "nock": "^13.2.2",
43
42
  "nyc": "^15.1.0"
44
43
  },
45
44
  "repository": {
package/src/display.js CHANGED
@@ -14,7 +14,7 @@ const tableOptions = {
14
14
  };
15
15
 
16
16
  function appendHttpStatusCodeLabel(statusCodeEntries) {
17
- statusCodeEntries.forEach((entry) => {
17
+ statusCodeEntries.forEach(entry => {
18
18
  let label = null;
19
19
  try {
20
20
  label = HTTPStatusCodes.getStatusText(entry[0]);
@@ -29,7 +29,7 @@ function appendHttpStatusCodeLabel(statusCodeEntries) {
29
29
 
30
30
  function displayRequestsSummary(attackResults) {
31
31
  const statusCodes = collapseArray(
32
- attackResults.requests.map((r) => r.status)
32
+ attackResults.requests.map(r => r.status)
33
33
  );
34
34
  const isEmptyResults = (statusCodes.length === 0);
35
35
 
@@ -17,11 +17,11 @@ async function makeRequest(url, options = {}) {
17
17
  };
18
18
  const protocol = getProtocol(url);
19
19
  return new Promise((resolve, reject) => {
20
- protocol.get(url, options, (res) => {
21
- res.addListener('data', (data) => {
20
+ protocol.get(url, options, res => {
21
+ res.addListener('data', data => {
22
22
  response.text += data.toString();
23
23
  });
24
- res.addListener('error', (err) => {
24
+ res.addListener('error', err => {
25
25
  reject(err);
26
26
  });
27
27
  res.addListener('end', () => {
@@ -6,7 +6,7 @@ const makeRequest = require('./local-fetch');
6
6
  const SECOND_IN_MILLISECONDS = 1000;
7
7
 
8
8
  function pause(timeoutInSeconds) {
9
- return new Promise((resolve) => {
9
+ return new Promise(resolve => {
10
10
  setTimeout(resolve, timeoutInSeconds * SECOND_IN_MILLISECONDS);
11
11
  });
12
12
  }
@@ -45,7 +45,7 @@ async function makeRequestsInConcurrentMode(url, durationInSeconds) {
45
45
  status(i);
46
46
 
47
47
  await makeRequest(url, { agent: false })
48
- .then((response) => {
48
+ .then(response => {
49
49
  requests.push(response);
50
50
  });
51
51
  }
@@ -9,7 +9,7 @@ function collapseArray(array) {
9
9
 
10
10
  const entries = Object.entries(hashMap);
11
11
 
12
- entries.forEach((entry) => {
12
+ entries.forEach(entry => {
13
13
  entry[0] = Number(entry[0]);
14
14
  });
15
15