makiwara 2.1.0 → 2.1.1
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/bin/cli.js +4 -5
- package/package.json +75 -70
package/bin/cli.js
CHANGED
|
@@ -57,6 +57,7 @@ if (!(STRATEGY_REGEXP).test(program.strategy)) {
|
|
|
57
57
|
const url = program.url;
|
|
58
58
|
const timeLimit = program.timelimit.split(',').map(Number);
|
|
59
59
|
const strategy = program.strategy;
|
|
60
|
+
let spinner = null;
|
|
60
61
|
|
|
61
62
|
function displayDelimiter() {
|
|
62
63
|
console.gray('----------------------------------------------------\n');
|
|
@@ -71,21 +72,19 @@ function displayHeader() {
|
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
async function sendTestRequest(testUrl) {
|
|
74
|
-
|
|
75
|
+
spinner.succeed(`Start testing... ${bold(testUrl)}`);
|
|
75
76
|
const response = await makeRequest(testUrl, { agent: false });
|
|
76
77
|
if (response.status !== HTTP_STATUS.OK) {
|
|
77
78
|
console.red(`HTTP Status Code: ${bold(response.status)}`);
|
|
78
79
|
console.yellow(`Response Body: ${bold(response.text)}`);
|
|
79
80
|
}
|
|
80
|
-
|
|
81
|
+
spinner.succeed(`Testing completed (response: ${bold(response.text.length)} Bytes)`);
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
async function main() {
|
|
84
85
|
displayHeader();
|
|
85
86
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
global.spinner = spinner;
|
|
87
|
+
spinner = ora('Loading').start();
|
|
89
88
|
|
|
90
89
|
try {
|
|
91
90
|
await sendTestRequest(url);
|
package/package.json
CHANGED
|
@@ -1,72 +1,77 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"
|
|
71
|
-
"
|
|
2
|
+
"name": "makiwara",
|
|
3
|
+
"description": "Benchmark URL to gain HTTP requests limits",
|
|
4
|
+
"version": "2.1.1",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Piotr Kowalski",
|
|
8
|
+
"email": "piecioshka@gmail.com",
|
|
9
|
+
"url": "https://piecioshka.pl/"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"clear": "rm -rf dist/ coverage/ .nyc_output/",
|
|
13
|
+
"clear:all": "rm -rf node_modules/ && npm run clear",
|
|
14
|
+
"test": "jasmine test/specs/*.js",
|
|
15
|
+
"coverage": "nyc npm run test && nyc report --reporter=text-lcov | coveralls -v",
|
|
16
|
+
"lint": "eslint .",
|
|
17
|
+
"snyk-protect": "snyk protect",
|
|
18
|
+
"prepare": "npm run snyk-protect"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@types/node": "^17.0.0",
|
|
22
|
+
"ansi-bold": "^0.1.1",
|
|
23
|
+
"ansi-cyan": "^0.1.1",
|
|
24
|
+
"ansi-gray": "^0.1.1",
|
|
25
|
+
"ansi-red": "^0.1.1",
|
|
26
|
+
"ansi-yellow": "^0.1.1",
|
|
27
|
+
"axios": "^0.24.0",
|
|
28
|
+
"commander": "^8.3.0",
|
|
29
|
+
"http-status-codes": "^2.1.4",
|
|
30
|
+
"is-url": "^1.2.4",
|
|
31
|
+
"node-fetch": "^3.1.0",
|
|
32
|
+
"ora": "^6.0.1",
|
|
33
|
+
"snyk": "^1.797.0",
|
|
34
|
+
"table": "^6.7.5"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/jasmine": "^3.10.2",
|
|
38
|
+
"coveralls": "^3.1.1",
|
|
39
|
+
"eslint": "^8.5.0",
|
|
40
|
+
"eslint-config-piecioshka": "^2.0.4",
|
|
41
|
+
"jasmine": "^3.10.0",
|
|
42
|
+
"nock": "^13.2.1",
|
|
43
|
+
"nyc": "^15.1.0"
|
|
44
|
+
},
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "https://github.com/piecioshka/makiwara.git"
|
|
48
|
+
},
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": "https://github.com/piecioshka/makiwara/issues"
|
|
51
|
+
},
|
|
52
|
+
"files": [
|
|
53
|
+
"bin",
|
|
54
|
+
"src",
|
|
55
|
+
"index.js",
|
|
56
|
+
"package.json",
|
|
57
|
+
"README.md"
|
|
58
|
+
],
|
|
59
|
+
"keywords": [
|
|
60
|
+
"app",
|
|
61
|
+
"test",
|
|
62
|
+
"attack",
|
|
63
|
+
"multi",
|
|
64
|
+
"statistics",
|
|
65
|
+
"summary",
|
|
66
|
+
"metrics",
|
|
67
|
+
"verify",
|
|
68
|
+
"request",
|
|
69
|
+
"time",
|
|
70
|
+
"analyze",
|
|
71
|
+
"cli",
|
|
72
|
+
"commonjs"
|
|
73
|
+
],
|
|
74
|
+
"main": "./index.js",
|
|
75
|
+
"bin": "./bin/cli.js",
|
|
76
|
+
"snyk": true
|
|
72
77
|
}
|