stack-analyze 1.1.5 → 1.1.8
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/.vscode/settings.json +4 -0
- package/CHANGELOG.md +23 -0
- package/{about/index.js → about.js} +13 -26
- package/cli.js +322 -0
- package/functions/animeInfo.js +9 -39
- package/functions/bitly.js +5 -7
- package/functions/cryptoList.js +17 -44
- package/functions/gitUser.js +6 -9
- package/functions/hardware.js +32 -24
- package/functions/moviesInfo.js +9 -38
- package/functions/multipleStack.js +9 -29
- package/functions/pageSpeed.js +13 -13
- package/functions/singleStack.js +9 -32
- package/functions/twitch.js +45 -0
- package/hash/aboutOpts.js +9 -16
- package/hash/hardwareTools.js +3 -3
- package/index.cjs +474 -0
- package/index.mjs +474 -0
- package/models/aboutTables.js +2 -19
- package/models/animeTable.js +33 -0
- package/models/cryptoTables.js +32 -0
- package/models/hardwareTables.js +87 -0
- package/models/movieTables.js +33 -0
- package/models/stackTables.js +23 -0
- package/models/twitchTables.js +28 -0
- package/package.json +24 -18
- package/readme.md +2 -2
- package/hash/mainTools.js +0 -145
- package/index.js +0 -170
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Table } from "console-table-printer";
|
|
2
|
+
|
|
3
|
+
const twitchTable = new Table({
|
|
4
|
+
columns: [
|
|
5
|
+
{
|
|
6
|
+
name: "display_name",
|
|
7
|
+
alignment: "left",
|
|
8
|
+
color: "green"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: "broadcaster_type",
|
|
12
|
+
alignment: "left",
|
|
13
|
+
color: "green"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: "view_count",
|
|
17
|
+
alignment: "left",
|
|
18
|
+
color: "yellow"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "createdTime",
|
|
22
|
+
alignment: "left",
|
|
23
|
+
color: "green"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export default twitchTable;
|
package/package.json
CHANGED
|
@@ -1,32 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stack-analyze",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "cli tech stack analyze and pagespeed with node.js using the wappalyzer module. with google pagespeed api, hardware and crypto market",
|
|
5
|
-
"main": "index.
|
|
6
|
+
"main": "index.mjs",
|
|
6
7
|
"bin": {
|
|
7
|
-
"stack-analyze": "
|
|
8
|
+
"stack-analyze": "cli.js"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"require": "./index.cjs",
|
|
13
|
+
"import": "./index.mjs"
|
|
14
|
+
}
|
|
8
15
|
},
|
|
9
16
|
"dependencies": {
|
|
10
|
-
"axios": "^0.
|
|
11
|
-
"cli-progress": "^3.
|
|
12
|
-
"coingecko-api": "^1.0.10",
|
|
17
|
+
"axios": "^0.27.2",
|
|
18
|
+
"cli-progress": "^3.11.0",
|
|
13
19
|
"colors": "^1.4.0",
|
|
14
|
-
"console-table-printer": "^2.
|
|
20
|
+
"console-table-printer": "^2.11.0",
|
|
15
21
|
"figlet": "^1.5.2",
|
|
16
|
-
"inquirer": "^8.2.
|
|
17
|
-
"systeminformation": "^5.
|
|
22
|
+
"inquirer": "^8.2.4",
|
|
23
|
+
"systeminformation": "^5.11.14",
|
|
18
24
|
"timeago.js": "^4.0.2",
|
|
19
|
-
"wappalyzer": "^6.
|
|
25
|
+
"wappalyzer": "^6.10.26"
|
|
20
26
|
},
|
|
21
27
|
"devDependencies": {
|
|
22
|
-
"eslint": "^
|
|
28
|
+
"eslint": "^8.15.0",
|
|
23
29
|
"gh-pages": "^3.2.3",
|
|
24
|
-
"jest": "^
|
|
25
|
-
"jsdoc": "^3.6.
|
|
30
|
+
"jest": "^28.1.0",
|
|
31
|
+
"jsdoc": "^3.6.10",
|
|
26
32
|
"minami": "^1.2.3"
|
|
27
33
|
},
|
|
28
34
|
"scripts": {
|
|
29
|
-
"start": "node
|
|
35
|
+
"start": "node cli.js",
|
|
30
36
|
"test": "jest",
|
|
31
37
|
"lint:test": "eslint . --ext .js",
|
|
32
38
|
"lint:fix": "eslint . --ext .js --fix",
|
|
@@ -35,7 +41,7 @@
|
|
|
35
41
|
},
|
|
36
42
|
"repository": {
|
|
37
43
|
"type": "git",
|
|
38
|
-
"url": "git+https://github.com/
|
|
44
|
+
"url": "git+https://github.com/stack-analyze/stack-analyze.git"
|
|
39
45
|
},
|
|
40
46
|
"keywords": [
|
|
41
47
|
"cli",
|
|
@@ -51,12 +57,12 @@
|
|
|
51
57
|
"crypto market info",
|
|
52
58
|
"movie info"
|
|
53
59
|
],
|
|
54
|
-
"author": "
|
|
60
|
+
"author": "stack-analyze",
|
|
55
61
|
"license": "MIT",
|
|
56
62
|
"bugs": {
|
|
57
|
-
"url": "https://github.com/
|
|
63
|
+
"url": "https://github.com/stack-analyze/stack-analyze/issues"
|
|
58
64
|
},
|
|
59
|
-
"homepage": "https://
|
|
65
|
+
"homepage": "https://stack-analyze.github.io/stack-analyze/",
|
|
60
66
|
"directories": {
|
|
61
67
|
"doc": "docs",
|
|
62
68
|
"test": "test"
|
package/readme.md
CHANGED
|
@@ -19,9 +19,9 @@ use the cli program install
|
|
|
19
19
|
>npm i -g stack-analyze "global install"<br>
|
|
20
20
|
>note: if global install fail using npx
|
|
21
21
|
|
|
22
|
-
[github repo](https://github.com/
|
|
22
|
+
[github repo](https://github.com/stack-analyze/stack-analyze.git)
|
|
23
23
|
|
|
24
|
-
[docs](https://
|
|
24
|
+
[docs](https://stack-analyze.github.io/stack-analyze/)
|
|
25
25
|
|
|
26
26
|
[gitlab repo](https://gitlab.com/Intermachine-dev/stack-analyze)
|
|
27
27
|
|
package/hash/mainTools.js
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
// modules
|
|
2
|
-
const inquirer = require("inquirer");
|
|
3
|
-
const { textSync } = require("figlet");
|
|
4
|
-
const { green } = require("colors");
|
|
5
|
-
|
|
6
|
-
// analyze web
|
|
7
|
-
const singleStack = require("../functions/singleStack");
|
|
8
|
-
const multipleStack = require("../functions/multipleStack");
|
|
9
|
-
|
|
10
|
-
// pagespeed web
|
|
11
|
-
const pageSpeed = require("../functions/pageSpeed");
|
|
12
|
-
|
|
13
|
-
// github info
|
|
14
|
-
const githubInfo = require("../functions/gitUser");
|
|
15
|
-
|
|
16
|
-
// anime search
|
|
17
|
-
const animeSearch = require("../functions/animeInfo");
|
|
18
|
-
|
|
19
|
-
// crypto market
|
|
20
|
-
const cryptoMarket = require("../functions/cryptoList");
|
|
21
|
-
|
|
22
|
-
// bitly
|
|
23
|
-
const bitlyInfo = require("../functions/bitly");
|
|
24
|
-
|
|
25
|
-
// movies
|
|
26
|
-
const movieDB = require("../functions/moviesInfo");
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @type {{ single(): Promise<void>, multiple(): Promise<void>, pagespeed(): Promise<void>, github_info(): Promise<void>, anime_search(): Promise<void>, cryto_market(): void, bitly_info(): Promise<void>, movie_info(): Promise<void> }}
|
|
30
|
-
*/
|
|
31
|
-
const mainTools = {
|
|
32
|
-
async single() {
|
|
33
|
-
console.clear();
|
|
34
|
-
const { url } = await inquirer.prompt({
|
|
35
|
-
name: "url",
|
|
36
|
-
message: "enter url for analyze the tech stack:"
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
url.indexOf("http") === 0
|
|
40
|
-
? singleStack(url)
|
|
41
|
-
: console.error("please insert a URL with parameter http:// or https://".red);
|
|
42
|
-
},
|
|
43
|
-
async multiple() {
|
|
44
|
-
console.clear();
|
|
45
|
-
const { urls } = await inquirer.prompt({
|
|
46
|
-
name: "urls",
|
|
47
|
-
message: "enter URLs for analyze the tech stacks with whitespace without quotes example 'http://example.com https://nodejs.org': \n"
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
if (
|
|
51
|
-
urls.match(/(http|https)/g) !== null ||
|
|
52
|
-
urls.match(/(http|https)/g) >= 2
|
|
53
|
-
) {
|
|
54
|
-
const websites = urls.split(" ");
|
|
55
|
-
console.clear();
|
|
56
|
-
multipleStack(websites);
|
|
57
|
-
} else {
|
|
58
|
-
console.error("please in each URL insert a website the parameter https:// or http://".red);
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
async pagespeed() {
|
|
62
|
-
console.clear();
|
|
63
|
-
const { speedWeb } = await inquirer.prompt({
|
|
64
|
-
name: "speedWeb",
|
|
65
|
-
message: "insert URL for page speed analyze:"
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
if (speedWeb.indexOf("http") === 0) {
|
|
69
|
-
console.clear();
|
|
70
|
-
console.info(green(textSync(speedWeb)));
|
|
71
|
-
|
|
72
|
-
// start pagespeed results mobile
|
|
73
|
-
textSync(speedWeb, "Small");
|
|
74
|
-
pageSpeed(speedWeb);
|
|
75
|
-
} else {
|
|
76
|
-
console.error("please insert a URL with parameter https;// or http://".red);
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
async github_info() {
|
|
80
|
-
const { user } = await inquirer.prompt({
|
|
81
|
-
name: "user",
|
|
82
|
-
message: "enter a github user"
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
if (user !== "") {
|
|
86
|
-
console.clear();
|
|
87
|
-
githubInfo(user);
|
|
88
|
-
} else {
|
|
89
|
-
console.error("please the github username is required".red);
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
async anime_search() {
|
|
93
|
-
const { anime } = await inquirer.prompt({
|
|
94
|
-
name: "anime",
|
|
95
|
-
message: "enter a anime, movie or ova search"
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
if (anime !== "") {
|
|
99
|
-
console.clear();
|
|
100
|
-
animeSearch(anime);
|
|
101
|
-
} else {
|
|
102
|
-
console.error("please the anime is required".red);
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
cryto_market() {
|
|
106
|
-
console.clear();
|
|
107
|
-
cryptoMarket();
|
|
108
|
-
},
|
|
109
|
-
async bitly_info() {
|
|
110
|
-
console.clear();
|
|
111
|
-
const { link, token } = await inquirer.prompt([
|
|
112
|
-
{
|
|
113
|
-
name: "link",
|
|
114
|
-
message: "enter a bitly link without http|https",
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
name: "token",
|
|
118
|
-
message: "enter a bitly token",
|
|
119
|
-
type: "password",
|
|
120
|
-
mask: "?"
|
|
121
|
-
}
|
|
122
|
-
]);
|
|
123
|
-
|
|
124
|
-
bitlyInfo(link, token);
|
|
125
|
-
},
|
|
126
|
-
async movie_info() {
|
|
127
|
-
const { api_key, query } = await inquirer.prompt([
|
|
128
|
-
{
|
|
129
|
-
name: "api_key",
|
|
130
|
-
message: "insert api key",
|
|
131
|
-
type: "password",
|
|
132
|
-
mask: "?"
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
name: "query",
|
|
136
|
-
message: "please search a movie search",
|
|
137
|
-
}
|
|
138
|
-
]);
|
|
139
|
-
|
|
140
|
-
movieDB(api_key, query);
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
// export
|
|
145
|
-
module.exports = mainTools;
|
package/index.js
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// modules
|
|
4
|
-
const { performance } = require("perf_hooks");
|
|
5
|
-
const inquirer = require("inquirer");
|
|
6
|
-
const { textSync } = require("figlet");
|
|
7
|
-
const { yellow, red } = require("colors");
|
|
8
|
-
|
|
9
|
-
// hash tables
|
|
10
|
-
const mainTools = require("./hash/mainTools");
|
|
11
|
-
const hardwareTools = require("./hash/hardwareTools");
|
|
12
|
-
const aboutTool = require("./hash/aboutOpts");
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @description about menu
|
|
16
|
-
* @return { Promise<void> } about option sections answer
|
|
17
|
-
*/
|
|
18
|
-
async function aboutOpts() {
|
|
19
|
-
const { about } = await inquirer.prompt({
|
|
20
|
-
type: "list",
|
|
21
|
-
pageSize: 9,
|
|
22
|
-
name: "about",
|
|
23
|
-
message: "select about option info",
|
|
24
|
-
choices: [
|
|
25
|
-
"main_info",
|
|
26
|
-
"lineup",
|
|
27
|
-
"youtube_recomendation",
|
|
28
|
-
"nonolive_recomendation",
|
|
29
|
-
"twitch_recomendation",
|
|
30
|
-
"projects_recomendation",
|
|
31
|
-
"tools_ideas",
|
|
32
|
-
"return to main menu"
|
|
33
|
-
]
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
if (about !== "return to main menu") {
|
|
37
|
-
aboutTool[about]();
|
|
38
|
-
setTimeout(aboutOpts, 1000);
|
|
39
|
-
} else {
|
|
40
|
-
question();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
*
|
|
46
|
-
* @description call the async function return list to question list
|
|
47
|
-
* @return { Promise<void> } - return in boolean a result question list
|
|
48
|
-
*
|
|
49
|
-
*/
|
|
50
|
-
async function returnQuestion() {
|
|
51
|
-
try {
|
|
52
|
-
const anw = await inquirer.prompt([
|
|
53
|
-
{
|
|
54
|
-
type: "confirm",
|
|
55
|
-
name: "return",
|
|
56
|
-
message: "do you want go to the tools menu?",
|
|
57
|
-
}
|
|
58
|
-
]);
|
|
59
|
-
|
|
60
|
-
if (anw.return) {
|
|
61
|
-
console.clear();
|
|
62
|
-
mainOptions();
|
|
63
|
-
} else {
|
|
64
|
-
question();
|
|
65
|
-
}
|
|
66
|
-
} catch (err) {
|
|
67
|
-
console.error(red(err.message));
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* @description call hardware information options
|
|
73
|
-
* @returns { Promise<void> } hardware options tool
|
|
74
|
-
*/
|
|
75
|
-
async function hardwareOpts() {
|
|
76
|
-
const { hardware } = await inquirer.prompt({
|
|
77
|
-
type: "list",
|
|
78
|
-
name: "hardware",
|
|
79
|
-
pageSize: 9,
|
|
80
|
-
message: "select a hardware-information option:",
|
|
81
|
-
choices: [
|
|
82
|
-
"cpu",
|
|
83
|
-
"ram_memory",
|
|
84
|
-
"os",
|
|
85
|
-
"disk",
|
|
86
|
-
"controller",
|
|
87
|
-
"display",
|
|
88
|
-
"bios",
|
|
89
|
-
"exit to main menu"
|
|
90
|
-
]
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
if(hardware !== "exit to main menu") {
|
|
94
|
-
hardwareTools[hardware]();
|
|
95
|
-
setTimeout(hardwareOpts, 1000);
|
|
96
|
-
} else {
|
|
97
|
-
question();
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
*
|
|
103
|
-
* @description call the function question raw list options
|
|
104
|
-
* @returns { Promise<void> } return main tools options
|
|
105
|
-
*
|
|
106
|
-
*/
|
|
107
|
-
async function mainOptions() {
|
|
108
|
-
const { main } = await inquirer.prompt({
|
|
109
|
-
type: "list",
|
|
110
|
-
pageSize: 9,
|
|
111
|
-
name: "main",
|
|
112
|
-
message: "",
|
|
113
|
-
choices: [
|
|
114
|
-
"single",
|
|
115
|
-
"multiple",
|
|
116
|
-
"pagespeed",
|
|
117
|
-
"github_info",
|
|
118
|
-
"anime_search",
|
|
119
|
-
"cryto_market",
|
|
120
|
-
"bitly_info",
|
|
121
|
-
"movie_info",
|
|
122
|
-
"return main menu"
|
|
123
|
-
]
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
if (main !== "return main menu") {
|
|
127
|
-
mainTools[main]();
|
|
128
|
-
const timeEnd = performance.now();
|
|
129
|
-
setTimeout(returnQuestion, timeEnd);
|
|
130
|
-
} else {
|
|
131
|
-
question();
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
*
|
|
137
|
-
* @description call the function question raw list options
|
|
138
|
-
* @returns { Promise<void> } return exit question
|
|
139
|
-
*
|
|
140
|
-
*/
|
|
141
|
-
async function question() {
|
|
142
|
-
console.clear();
|
|
143
|
-
console.info(yellow(textSync("stack-analyze")));
|
|
144
|
-
const { analyze } = await inquirer.prompt({
|
|
145
|
-
type: "list",
|
|
146
|
-
name: "analyze",
|
|
147
|
-
message: "what option do you want to analyze stack",
|
|
148
|
-
choices: ["main tools", "hardware tools", "about", "exit"]
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
switch (analyze) {
|
|
152
|
-
case "main tools":
|
|
153
|
-
mainOptions();
|
|
154
|
-
break;
|
|
155
|
-
case "hardware tools":
|
|
156
|
-
hardwareOpts();
|
|
157
|
-
break;
|
|
158
|
-
case "about":
|
|
159
|
-
aboutOpts();
|
|
160
|
-
break;
|
|
161
|
-
default:
|
|
162
|
-
console.clear();
|
|
163
|
-
console.info("thanks for use stack-analyze".green);
|
|
164
|
-
break;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
// call the message title and question list
|
|
169
|
-
question();
|
|
170
|
-
|