stack-analyze 1.1.6 → 1.1.7
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 +13 -0
- package/{about/index.js → about.js} +6 -4
- package/cli.js +12 -11
- package/env/bitly.env.js +1 -0
- package/env/movie.env.js +1 -0
- package/env/twitchID.env.js +1 -0
- package/functions/animeInfo.js +9 -39
- package/functions/bitly.js +8 -9
- package/functions/cryptoList.js +9 -38
- package/functions/gitUser.js +6 -9
- package/functions/hardware.js +32 -24
- package/functions/moviesInfo.js +10 -38
- package/functions/multipleStack.js +9 -29
- package/functions/pageSpeed.js +13 -13
- package/functions/singleStack.js +9 -32
- package/functions/twitch.js +46 -0
- package/hash/aboutOpts.js +9 -11
- package/hash/hardwareTools.js +3 -3
- package/hash/infoTools.js +46 -24
- package/hash/mainTools.js +9 -9
- package/{index.js → index.cjs} +167 -52
- package/index.mjs +474 -0
- package/models/aboutTables.js +2 -2
- 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 +16 -9
package/functions/singleStack.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// module
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import Wappalyzer from "wappalyzer";
|
|
3
|
+
import figlet from "figlet";
|
|
4
|
+
import colors from "colors";
|
|
5
|
+
import stackTable from "../models/stackTables.js";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
*
|
|
@@ -11,30 +11,9 @@ const { Table } = require("console-table-printer");
|
|
|
11
11
|
* @returns { Promise<void> } - return async results single web
|
|
12
12
|
*
|
|
13
13
|
*/
|
|
14
|
-
async function singleStack(url) {
|
|
14
|
+
export default async function singleStack(url) {
|
|
15
15
|
const wappalyzer = await new Wappalyzer;
|
|
16
16
|
|
|
17
|
-
const p = new Table({
|
|
18
|
-
columns: [
|
|
19
|
-
{
|
|
20
|
-
name: "techName",
|
|
21
|
-
alignment: "left",
|
|
22
|
-
color: "cyan"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: "techWebsite",
|
|
26
|
-
alignment: "left",
|
|
27
|
-
color: "green"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: "techCategories",
|
|
31
|
-
alignment: "left",
|
|
32
|
-
color: "cyan"
|
|
33
|
-
}
|
|
34
|
-
]
|
|
35
|
-
|
|
36
|
-
});
|
|
37
|
-
|
|
38
17
|
try {
|
|
39
18
|
await wappalyzer.init();
|
|
40
19
|
|
|
@@ -50,16 +29,14 @@ async function singleStack(url) {
|
|
|
50
29
|
techCategories: categories.map(({ name }) => name).join(", ")
|
|
51
30
|
}));
|
|
52
31
|
|
|
53
|
-
console.info(green(textSync(url)));
|
|
32
|
+
console.info(colors.green(figlet.textSync(url)));
|
|
54
33
|
|
|
55
|
-
|
|
34
|
+
stackTable.addRows(stackResult);
|
|
56
35
|
|
|
57
|
-
|
|
36
|
+
stackTable.printTable();
|
|
58
37
|
} catch (err) {
|
|
59
|
-
console.error(red(err.message));
|
|
38
|
+
console.error(colors.red(err.message));
|
|
60
39
|
}
|
|
61
40
|
|
|
62
41
|
await wappalyzer.destroy();
|
|
63
42
|
}
|
|
64
|
-
|
|
65
|
-
module.exports = singleStack;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// modules
|
|
2
|
+
import "../env/twitchID.env.js";
|
|
3
|
+
import axios from "axios";
|
|
4
|
+
import { format } from "timeago.js";
|
|
5
|
+
import colors from "colors";
|
|
6
|
+
|
|
7
|
+
// table
|
|
8
|
+
import twitchTable from "../models/twitchTables.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @description twitch user info
|
|
13
|
+
* @param {string} twitchUser - twitch user for search
|
|
14
|
+
* @param {string} apiToken - twitch api token
|
|
15
|
+
* @returns { Promise<void> } - return twitch results
|
|
16
|
+
*/
|
|
17
|
+
const twitchInfo = async (twitchUser, apiToken) => {
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
const { data: twitchData } = await axios.get(`https://api.twitch.tv/helix/users?login=${twitchUser}`, {
|
|
21
|
+
headers: {
|
|
22
|
+
Authorization: `Bearer ${apiToken}`,
|
|
23
|
+
"Client-Id": process.env.CLIENT_ID
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const result = twitchData.data.map(({
|
|
28
|
+
display_name,
|
|
29
|
+
broadcaster_type,
|
|
30
|
+
view_count,
|
|
31
|
+
created_at
|
|
32
|
+
}) => ({
|
|
33
|
+
display_name,
|
|
34
|
+
broadcaster_type,
|
|
35
|
+
view_count,
|
|
36
|
+
createdTime: format(created_at)
|
|
37
|
+
}));
|
|
38
|
+
|
|
39
|
+
twitchTable.addRows(result);
|
|
40
|
+
twitchTable.printTable();
|
|
41
|
+
} catch (err) {
|
|
42
|
+
console.error(colors.red(err));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export default twitchInfo;
|
package/hash/aboutOpts.js
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
// print table
|
|
2
|
-
|
|
2
|
+
import { printTable } from "console-table-printer";
|
|
3
3
|
|
|
4
4
|
// tables models
|
|
5
|
-
|
|
5
|
+
import {
|
|
6
6
|
youtubeDevTable,
|
|
7
|
-
nonoliveTable,
|
|
8
7
|
ideasTable
|
|
9
|
-
}
|
|
8
|
+
} from "../models/aboutTables.js";
|
|
10
9
|
|
|
11
10
|
// about sections
|
|
12
|
-
|
|
11
|
+
import {
|
|
13
12
|
aboutApp,
|
|
14
13
|
developers,
|
|
15
|
-
youtubeDev,
|
|
16
|
-
nonolive,
|
|
17
14
|
twitch,
|
|
18
15
|
projects,
|
|
19
|
-
ideas
|
|
20
|
-
|
|
16
|
+
ideas,
|
|
17
|
+
youtubeDev
|
|
18
|
+
} from "../about.js";
|
|
21
19
|
|
|
22
|
-
/** @type {{ main_info(): void, lineup(): void, youtube_recomendation(): void,
|
|
20
|
+
/** @type {{ main_info(): void, lineup(): void, youtube_recomendation(): void, twitch_recomendation(): void, projects_recomendation(): void, tools_ideas(): void }} */
|
|
23
21
|
const aboutTool = {
|
|
24
22
|
main_info() {
|
|
25
23
|
console.clear();
|
|
@@ -52,4 +50,4 @@ const aboutTool = {
|
|
|
52
50
|
};
|
|
53
51
|
|
|
54
52
|
// export hash
|
|
55
|
-
|
|
53
|
+
export default aboutTool;
|
package/hash/hardwareTools.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// hardware modules
|
|
2
|
-
|
|
2
|
+
import {
|
|
3
3
|
cpuInfo,
|
|
4
4
|
ramMemInfo,
|
|
5
5
|
osDetail,
|
|
@@ -7,7 +7,7 @@ const {
|
|
|
7
7
|
controllerInfo,
|
|
8
8
|
displayInfo,
|
|
9
9
|
biosInfo
|
|
10
|
-
}
|
|
10
|
+
} from "../functions/hardware.js";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @type {{ cpu(): void, ram_memory(): void, os(): void, disk(): void, controller(): void, display(): void, bios(): void }}
|
|
@@ -44,4 +44,4 @@ const hardwareTools = {
|
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
// exports
|
|
47
|
-
|
|
47
|
+
export default hardwareTools;
|
package/hash/infoTools.js
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
// modules
|
|
2
|
-
|
|
2
|
+
import inquirer from "inquirer";
|
|
3
3
|
|
|
4
4
|
// github info
|
|
5
|
-
|
|
5
|
+
import githubInfo from "../functions/gitUser.js";
|
|
6
6
|
|
|
7
7
|
// anime search
|
|
8
|
-
|
|
8
|
+
import animeSearch from "../functions/animeInfo.js";
|
|
9
9
|
|
|
10
10
|
// crypto market
|
|
11
|
-
|
|
11
|
+
import cryptoMarket from "../functions/cryptoList.js";
|
|
12
12
|
|
|
13
13
|
// bitly
|
|
14
|
-
|
|
14
|
+
import bitlyInfo from "../functions/bitly.js";
|
|
15
15
|
|
|
16
16
|
// movies
|
|
17
|
-
|
|
17
|
+
import movieDB from "../functions/moviesInfo.js";
|
|
18
|
+
|
|
19
|
+
// twitch
|
|
20
|
+
import twitchInfo from "../functions/twitch.js";
|
|
18
21
|
|
|
19
22
|
|
|
20
23
|
/**
|
|
21
|
-
* @type {{ github_info(): Promise<void>, anime_search(): Promise<void>, crypto_market(): void, bitly_info(): Promise<void>, movie_info(): Promise<void>
|
|
24
|
+
* @type {{ github_info(): Promise<void>, anime_search(): Promise<void>, crypto_market(): void, bitly_info(): Promise<void>, movie_info(): Promise<void>, twitch_info(): Promise<void>}}
|
|
22
25
|
*/
|
|
23
26
|
const infoTools = {
|
|
24
27
|
async github_info() {
|
|
@@ -53,38 +56,57 @@ const infoTools = {
|
|
|
53
56
|
},
|
|
54
57
|
async bitly_info() {
|
|
55
58
|
console.clear();
|
|
56
|
-
const { link
|
|
59
|
+
const { link } = await inquirer.prompt([
|
|
57
60
|
{
|
|
58
61
|
name: "link",
|
|
59
62
|
message: "enter a bitly link without http|https",
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: "token",
|
|
63
|
-
message: "enter a bitly token",
|
|
64
|
-
type: "password",
|
|
65
|
-
mask: "?"
|
|
66
63
|
}
|
|
67
64
|
]);
|
|
68
65
|
|
|
69
|
-
|
|
66
|
+
if (link !== "") {
|
|
67
|
+
console.clear();
|
|
68
|
+
bitlyInfo(link);
|
|
69
|
+
} else {
|
|
70
|
+
console.error("bitly link is required".red);
|
|
71
|
+
}
|
|
70
72
|
},
|
|
71
73
|
async movie_info() {
|
|
72
|
-
const {
|
|
73
|
-
{
|
|
74
|
-
name: "api_key",
|
|
75
|
-
message: "insert api key",
|
|
76
|
-
type: "password",
|
|
77
|
-
mask: "?"
|
|
78
|
-
},
|
|
74
|
+
const { query } = await inquirer.prompt([
|
|
79
75
|
{
|
|
80
76
|
name: "query",
|
|
81
77
|
message: "please search a movie search",
|
|
82
78
|
}
|
|
83
79
|
]);
|
|
84
80
|
|
|
85
|
-
|
|
81
|
+
if (query !== "") {
|
|
82
|
+
console.clear();
|
|
83
|
+
movieDB(query);
|
|
84
|
+
} else {
|
|
85
|
+
console.error("please the movie is required".red);
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
async twitch_info() {
|
|
89
|
+
const { user, twitch_token } = await inquirer.prompt([
|
|
90
|
+
{
|
|
91
|
+
name: "user",
|
|
92
|
+
message: "get twitch user"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: "twitch_token",
|
|
96
|
+
message: "enter a twitch token without the key Bearer",
|
|
97
|
+
type: "password",
|
|
98
|
+
mask: "?"
|
|
99
|
+
}
|
|
100
|
+
]);
|
|
101
|
+
|
|
102
|
+
if (user !== "" && twitch_token !== "") {
|
|
103
|
+
console.clear();
|
|
104
|
+
twitchInfo(user, twitch_token);
|
|
105
|
+
} else {
|
|
106
|
+
console.error("twitch info fields is required".red);
|
|
107
|
+
}
|
|
86
108
|
}
|
|
87
109
|
};
|
|
88
110
|
|
|
89
111
|
// exports
|
|
90
|
-
|
|
112
|
+
export default infoTools;
|
package/hash/mainTools.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// modules
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import inquirer from "inquirer";
|
|
3
|
+
import figlet from "figlet";
|
|
4
|
+
import colors from "colors";
|
|
5
5
|
|
|
6
6
|
// analyze web
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import singleStack from "../functions/singleStack.js";
|
|
8
|
+
import multipleStack from "../functions/multipleStack.js";
|
|
9
9
|
|
|
10
10
|
// pagespeed web
|
|
11
|
-
|
|
11
|
+
import pageSpeed from "../functions/pageSpeed.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @type {{ single(): Promise<void>, multiple(): Promise<void>, pagespeed(): Promise<void> }}
|
|
@@ -52,10 +52,10 @@ const mainTools = {
|
|
|
52
52
|
|
|
53
53
|
if (speedWeb.indexOf("http") === 0) {
|
|
54
54
|
console.clear();
|
|
55
|
-
console.info(green(textSync(speedWeb)));
|
|
55
|
+
console.info(colors.green(figlet.textSync(speedWeb)));
|
|
56
56
|
|
|
57
57
|
// start pagespeed results mobile
|
|
58
|
-
textSync(speedWeb, "Small");
|
|
58
|
+
figlet.textSync(speedWeb, "Small");
|
|
59
59
|
pageSpeed(speedWeb);
|
|
60
60
|
} else {
|
|
61
61
|
console.error("please insert a URL with parameter https;// or http://".red);
|
|
@@ -64,4 +64,4 @@ const mainTools = {
|
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
// export
|
|
67
|
-
|
|
67
|
+
export default mainTools;
|