stack-analyze 1.2.3 → 1.2.4
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/CHANGELOG.md +11 -0
- package/functions/bundlephobia.js +1 -1
- package/functions/gitUser.js +1 -1
- package/functions/hardware.js +3 -42
- package/functions/multipleStack.js +1 -1
- package/functions/scraping.js +1 -2
- package/functions/singleStack.js +1 -1
- package/hardware.csv +0 -0
- package/package.json +7 -8
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
stack-analyze all version and notable changes, fixed, remove and new additions in code.
|
|
4
4
|
|
|
5
|
+
## version 1.2.4
|
|
6
|
+
### Changed
|
|
7
|
+
- remove jest module by node:test
|
|
8
|
+
- web scraping & github info using native fetch api & not axios
|
|
9
|
+
### fixed
|
|
10
|
+
- fixed errors in:
|
|
11
|
+
- single stack
|
|
12
|
+
- multiple
|
|
13
|
+
- hardware information
|
|
14
|
+
- single & multiple stack using sub await mode
|
|
15
|
+
|
|
5
16
|
## version 1.2.3
|
|
6
17
|
### Added
|
|
7
18
|
- bundlephobia info tool
|
|
@@ -10,7 +10,7 @@ import { stackSave } from "../utils.js";
|
|
|
10
10
|
const kilobyteConvert = (size) => (size < 1024 ? `${size} B` : `${size / 1024} KB`);
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* @description
|
|
13
|
+
* @description get info of npm package
|
|
14
14
|
* @param {string} pkg
|
|
15
15
|
* @async
|
|
16
16
|
* @returns { Promise<void> } - return result bundlephobia info
|
package/functions/gitUser.js
CHANGED
|
@@ -16,7 +16,7 @@ import { stackSave } from "../utils.js";
|
|
|
16
16
|
*/
|
|
17
17
|
export default async function githubInfo(user) {
|
|
18
18
|
try {
|
|
19
|
-
const
|
|
19
|
+
const data = await (await fetch(`https://api.github.com/users/${user}`)).json();
|
|
20
20
|
|
|
21
21
|
const info = {
|
|
22
22
|
username: data.login,
|
package/functions/hardware.js
CHANGED
|
@@ -35,30 +35,12 @@ export default async function hardware() {
|
|
|
35
35
|
// bios info
|
|
36
36
|
const biosInfo = await bios();
|
|
37
37
|
|
|
38
|
-
for (const key in biosInfo) {
|
|
39
|
-
if (!biosInfo[key]) {
|
|
40
|
-
delete biosInfo[key];
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
38
|
hardwareinfo.write(csvHeader(biosInfo));
|
|
45
39
|
hardwareinfo.write(csvData(biosInfo, "\n\n"));
|
|
46
40
|
|
|
47
41
|
// cpu info
|
|
48
42
|
const cpuInfo = await cpu();
|
|
49
43
|
|
|
50
|
-
for (const key in cpuInfo) {
|
|
51
|
-
if (!cpuInfo[key]) {
|
|
52
|
-
delete cpuInfo[key];
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
for (const key in cpuInfo.cache) {
|
|
57
|
-
if (!cpuInfo.cache[key]) {
|
|
58
|
-
delete cpuInfo.cache[key];
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
44
|
cpuInfo.cache = Object.entries(cpuInfo.cache)
|
|
63
45
|
.map(([key, value]) => `${key}: ${value}`)
|
|
64
46
|
.join(" ");
|
|
@@ -69,12 +51,6 @@ export default async function hardware() {
|
|
|
69
51
|
// os info
|
|
70
52
|
const os = await osInfo();
|
|
71
53
|
|
|
72
|
-
for (const key in os) {
|
|
73
|
-
if (!os[key]) {
|
|
74
|
-
delete os[key];
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
54
|
hardwareinfo.write(csvHeader(os));
|
|
79
55
|
hardwareinfo.write(csvData(os, "\n\n"));
|
|
80
56
|
|
|
@@ -87,26 +63,21 @@ export default async function hardware() {
|
|
|
87
63
|
}
|
|
88
64
|
|
|
89
65
|
hardwareinfo.write(csvHeader(ram));
|
|
90
|
-
hardwareinfo.write(csvData(ram));
|
|
66
|
+
hardwareinfo.write(csvData(ram, "\n\n"));
|
|
91
67
|
|
|
92
68
|
// disks
|
|
93
69
|
const disks = await diskLayout();
|
|
94
70
|
|
|
95
71
|
disks.forEach(disk => {
|
|
96
72
|
for (const key in disk) {
|
|
97
|
-
if (!disk[key]) {
|
|
98
|
-
delete disk[key];
|
|
99
|
-
}
|
|
100
|
-
|
|
101
73
|
if (typeof disk[key] === "number") {
|
|
102
|
-
disk[key] = `${gigabyteConvert(
|
|
74
|
+
disk[key] = `${gigabyteConvert(disk[key])} GB`;
|
|
103
75
|
}
|
|
104
76
|
}
|
|
105
77
|
|
|
106
78
|
hardwareinfo.write(csvHeader(disk));
|
|
107
|
-
hardwareinfo.write(csvData(disk, "\n"));
|
|
79
|
+
hardwareinfo.write(csvData(disk, "\n\n"));
|
|
108
80
|
});
|
|
109
|
-
hardwareinfo.write("\n");
|
|
110
81
|
|
|
111
82
|
/* displays & controllers */
|
|
112
83
|
const { displays, controllers } = await graphics();
|
|
@@ -114,10 +85,6 @@ export default async function hardware() {
|
|
|
114
85
|
// controllers
|
|
115
86
|
controllers.forEach(controller => {
|
|
116
87
|
for (const key in controller) {
|
|
117
|
-
if (!controller[key]) {
|
|
118
|
-
delete controller[key];
|
|
119
|
-
}
|
|
120
|
-
|
|
121
88
|
if (typeof controller[key] === "number") {
|
|
122
89
|
controller[key] = controller[key] < 1024
|
|
123
90
|
? `${controller[key]} MB`
|
|
@@ -132,12 +99,6 @@ export default async function hardware() {
|
|
|
132
99
|
hardwareinfo.write("\n");
|
|
133
100
|
|
|
134
101
|
displays.forEach(display => {
|
|
135
|
-
for (const key in display) {
|
|
136
|
-
if (!display[key]) {
|
|
137
|
-
delete display[key];
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
102
|
hardwareinfo.write(csvHeader(display));
|
|
142
103
|
hardwareinfo.write(csvData(display, "\n"));
|
|
143
104
|
});
|
|
@@ -24,7 +24,7 @@ export default async function multipleStack(urlList) {
|
|
|
24
24
|
for await (const url of urlList) {
|
|
25
25
|
console.info(url.green);
|
|
26
26
|
|
|
27
|
-
const { technologies } = await wappalyzer.open(url).analyze();
|
|
27
|
+
const { technologies } = await (await wappalyzer.open(url)).analyze();
|
|
28
28
|
|
|
29
29
|
const stackResult = technologies.map(({
|
|
30
30
|
name,
|
package/functions/scraping.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
1
|
import { load } from "cheerio";
|
|
3
2
|
import colors from "colors";
|
|
4
3
|
import { printTable } from "console-table-printer";
|
|
@@ -16,7 +15,7 @@ import { stackSave } from "../utils.js";
|
|
|
16
15
|
*/
|
|
17
16
|
export default async function scrape(url, options) {
|
|
18
17
|
try {
|
|
19
|
-
const
|
|
18
|
+
const data = await (await fetch(url)).text();
|
|
20
19
|
const $ = load(data);
|
|
21
20
|
|
|
22
21
|
let result;
|
package/functions/singleStack.js
CHANGED
|
@@ -19,7 +19,7 @@ export default async function singleStack(url) {
|
|
|
19
19
|
try {
|
|
20
20
|
await wappalyzer.init();
|
|
21
21
|
|
|
22
|
-
const { technologies } = await wappalyzer.open(url).analyze();
|
|
22
|
+
const { technologies } = await (await wappalyzer.open(url)).analyze();
|
|
23
23
|
|
|
24
24
|
const stackResult = technologies.map(({
|
|
25
25
|
name,
|
package/hardware.csv
ADDED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stack-analyze",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "cli tech stack analyze and pagespeed with node.js using the wappalyzer module. with google pagespeed api, hardware and crypto market",
|
|
6
6
|
"main": "index.mjs",
|
|
@@ -14,22 +14,21 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"axios": "^1.
|
|
17
|
+
"axios": "^1.4.0",
|
|
18
18
|
"cheerio": "^1.0.0-rc.12",
|
|
19
19
|
"cli-progress": "^3.12.0",
|
|
20
20
|
"colors": "^1.4.0",
|
|
21
21
|
"console-table-printer": "^2.11.1",
|
|
22
|
-
"figlet": "^1.
|
|
23
|
-
"gauge": "^5.0.
|
|
24
|
-
"inquirer": "^9.
|
|
22
|
+
"figlet": "^1.6.0",
|
|
23
|
+
"gauge": "^5.0.1",
|
|
24
|
+
"inquirer": "^9.2.0",
|
|
25
25
|
"systeminformation": "^5.17.12",
|
|
26
26
|
"timeago.js": "^4.0.2",
|
|
27
|
-
"wappalyzer": "^6.10.
|
|
27
|
+
"wappalyzer": "^6.10.62"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"eslint": "^8.
|
|
30
|
+
"eslint": "^8.39.0",
|
|
31
31
|
"gh-pages": "^5.0.0",
|
|
32
|
-
"jest": "^29.4.3",
|
|
33
32
|
"jsdoc": "^4.0.2"
|
|
34
33
|
},
|
|
35
34
|
"scripts": {
|