stack-analyze 1.3.4 → 1.3.6
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 +326 -296
- package/LICENSE +21 -21
- package/{about.cjs → about.js} +121 -121
- package/api/pokerApi.js +5 -0
- package/api/wallpapersURL.js +7 -6
- package/api/webApis.js +21 -21
- package/cli.js +213 -227
- package/eslint.config.js +44 -44
- package/functions/animeInfo.js +45 -45
- package/functions/bitly.js +41 -41
- package/functions/bundlephobia.js +36 -36
- package/functions/cryptoList.js +48 -48
- package/functions/cssValidator.js +25 -25
- package/functions/deezer.js +37 -37
- package/functions/download.js +25 -24
- package/functions/gitUser.js +37 -37
- package/functions/hardware.js +109 -109
- package/functions/moviesInfo.js +55 -55
- package/functions/multipleStack.js +53 -53
- package/functions/pageSpeed.js +82 -82
- package/functions/password.js +24 -24
- package/functions/pokemon.js +106 -106
- package/functions/poker.js +40 -0
- package/functions/potterSearch.js +32 -32
- package/functions/scraping.js +132 -132
- package/functions/singleStack.js +48 -48
- package/functions/twitch.js +72 -72
- package/hash/infoTools.js +61 -57
- package/hash/queryTools.js +116 -119
- package/hash/utilityTools.js +32 -19
- package/hash/wallpaperSelect.js +89 -76
- package/hash/webTools.js +92 -68
- package/logo-module.webp +0 -0
- package/menu.js +13 -0
- package/package.json +67 -66
- package/prompts/webPrompts.js +31 -0
- package/readme.md +44 -44
- package/utils.js +104 -94
- package/validations/infoValidations.js +37 -37
- package/validations/webValidations.js +33 -33
package/functions/twitch.js
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
// modules
|
|
2
|
-
import axios from "axios";
|
|
3
|
-
import { format } from "timeago.js";
|
|
4
|
-
import { printTable } from "console-table-printer";
|
|
5
|
-
import colors from "colors";
|
|
6
|
-
|
|
7
|
-
// save twitch users
|
|
8
|
-
import { stackSave } from "../utils.js";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* types for twitch info
|
|
12
|
-
*
|
|
13
|
-
* @typedef {Object} Twitch
|
|
14
|
-
* @property {string} Twitch.twitchUsers
|
|
15
|
-
* @property {string} Twitch.twitchSeparator
|
|
16
|
-
* @property {string} Twitch.twitchToken
|
|
17
|
-
* @property {string} Twitch.twitchClient
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @description twitch user info
|
|
22
|
-
* @async
|
|
23
|
-
* @param {Twitch} param
|
|
24
|
-
* @returns { Promise<void> } - return twitch results
|
|
25
|
-
*/
|
|
26
|
-
export default async function twitchInfo({
|
|
27
|
-
twitchUsers,
|
|
28
|
-
twitchSeparator,
|
|
29
|
-
twitchToken,
|
|
30
|
-
twitchClient
|
|
31
|
-
}) {
|
|
32
|
-
|
|
33
|
-
const userList = twitchUsers.split(twitchSeparator);
|
|
34
|
-
|
|
35
|
-
if(userList.length === 10) {
|
|
36
|
-
console.error("twitch users must be 10".bgRed);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const params = new URLSearchParams();
|
|
40
|
-
|
|
41
|
-
userList.forEach((item) => {
|
|
42
|
-
params.append("login", item);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
try {
|
|
46
|
-
const { data: twitchData } = await axios.get("https://api.twitch.tv/helix/users", {
|
|
47
|
-
params,
|
|
48
|
-
headers: {
|
|
49
|
-
Authorization: `Bearer ${twitchToken}`,
|
|
50
|
-
"Client-Id": twitchClient
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
const result = twitchData.data.map(({
|
|
55
|
-
display_name,
|
|
56
|
-
broadcaster_type,
|
|
57
|
-
view_count,
|
|
58
|
-
created_at
|
|
59
|
-
}) => ({
|
|
60
|
-
username: display_name,
|
|
61
|
-
broadcaster: broadcaster_type || "user",
|
|
62
|
-
viewCount: view_count,
|
|
63
|
-
accountDate: new Date(created_at).toLocaleDateString(),
|
|
64
|
-
accountAge: format(created_at)
|
|
65
|
-
}));
|
|
66
|
-
|
|
67
|
-
printTable(result);
|
|
68
|
-
stackSave("twitch-users.json", JSON.stringify(result, null, 2));
|
|
69
|
-
} catch (err) {
|
|
70
|
-
console.error(colors.red(err));
|
|
71
|
-
}
|
|
72
|
-
}
|
|
1
|
+
// modules
|
|
2
|
+
import axios from "axios";
|
|
3
|
+
import { format } from "timeago.js";
|
|
4
|
+
import { printTable } from "console-table-printer";
|
|
5
|
+
import colors from "colors";
|
|
6
|
+
|
|
7
|
+
// save twitch users
|
|
8
|
+
import { stackSave } from "../utils.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* types for twitch info
|
|
12
|
+
*
|
|
13
|
+
* @typedef {Object} Twitch
|
|
14
|
+
* @property {string} Twitch.twitchUsers
|
|
15
|
+
* @property {string} Twitch.twitchSeparator
|
|
16
|
+
* @property {string} Twitch.twitchToken
|
|
17
|
+
* @property {string} Twitch.twitchClient
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @description twitch user info
|
|
22
|
+
* @async
|
|
23
|
+
* @param {Twitch} param
|
|
24
|
+
* @returns { Promise<void> } - return twitch results
|
|
25
|
+
*/
|
|
26
|
+
export default async function twitchInfo({
|
|
27
|
+
twitchUsers,
|
|
28
|
+
twitchSeparator,
|
|
29
|
+
twitchToken,
|
|
30
|
+
twitchClient
|
|
31
|
+
}) {
|
|
32
|
+
|
|
33
|
+
const userList = twitchUsers.split(twitchSeparator);
|
|
34
|
+
|
|
35
|
+
if(userList.length === 10) {
|
|
36
|
+
console.error("twitch users must be 10".bgRed);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const params = new URLSearchParams();
|
|
40
|
+
|
|
41
|
+
userList.forEach((item) => {
|
|
42
|
+
params.append("login", item);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
try {
|
|
46
|
+
const { data: twitchData } = await axios.get("https://api.twitch.tv/helix/users", {
|
|
47
|
+
params,
|
|
48
|
+
headers: {
|
|
49
|
+
Authorization: `Bearer ${twitchToken}`,
|
|
50
|
+
"Client-Id": twitchClient
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const result = twitchData.data.map(({
|
|
55
|
+
display_name,
|
|
56
|
+
broadcaster_type,
|
|
57
|
+
view_count,
|
|
58
|
+
created_at
|
|
59
|
+
}) => ({
|
|
60
|
+
username: display_name,
|
|
61
|
+
broadcaster: broadcaster_type || "user",
|
|
62
|
+
viewCount: view_count,
|
|
63
|
+
accountDate: new Date(created_at).toLocaleDateString(),
|
|
64
|
+
accountAge: format(created_at)
|
|
65
|
+
}));
|
|
66
|
+
|
|
67
|
+
printTable(result);
|
|
68
|
+
stackSave("twitch-users.json", JSON.stringify(result, null, 2));
|
|
69
|
+
} catch (err) {
|
|
70
|
+
console.error(colors.red(err.message));
|
|
71
|
+
}
|
|
72
|
+
}
|
package/hash/infoTools.js
CHANGED
|
@@ -1,57 +1,61 @@
|
|
|
1
|
-
// inquirer
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
// functions
|
|
5
|
-
import bitlyInfo from "../functions/bitly.js";
|
|
6
|
-
import cryptoMarket from "../functions/cryptoList.js";
|
|
7
|
-
import githubInfo from "../functions/gitUser.js";
|
|
8
|
-
import bundlephobia from "../functions/bundlephobia.js";
|
|
9
|
-
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
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
|
-
|
|
1
|
+
// inquirer
|
|
2
|
+
import { input, password } from "@inquirer/prompts";
|
|
3
|
+
|
|
4
|
+
// functions
|
|
5
|
+
import bitlyInfo from "../functions/bitly.js";
|
|
6
|
+
import cryptoMarket from "../functions/cryptoList.js";
|
|
7
|
+
import githubInfo from "../functions/gitUser.js";
|
|
8
|
+
import bundlephobia from "../functions/bundlephobia.js";
|
|
9
|
+
|
|
10
|
+
// bitly regexp
|
|
11
|
+
const bitlyRegexp = /bit\.ly\//g;
|
|
12
|
+
|
|
13
|
+
const infoTools = {
|
|
14
|
+
async github_info(refreshCallback) {
|
|
15
|
+
console.clear();
|
|
16
|
+
|
|
17
|
+
const gitUser = await input({
|
|
18
|
+
message: "enter a github user for search",
|
|
19
|
+
required: true
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
githubInfo(gitUser);
|
|
23
|
+
setTimeout(refreshCallback, 2e3);
|
|
24
|
+
},
|
|
25
|
+
async bitly_info(refreshCallback) {
|
|
26
|
+
console.clear();
|
|
27
|
+
|
|
28
|
+
const { bitlyLink, token } = {
|
|
29
|
+
bitlyLink: await input({
|
|
30
|
+
message: "enter a short link:",
|
|
31
|
+
validate: input => bitlyRegexp.test(input) || "only bitly link".yellow
|
|
32
|
+
}),
|
|
33
|
+
token: await password({
|
|
34
|
+
message: "enter a bitly token",
|
|
35
|
+
required: true,
|
|
36
|
+
mask: true
|
|
37
|
+
})
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
bitlyInfo(bitlyLink, token);
|
|
41
|
+
setTimeout(refreshCallback, 2e3);
|
|
42
|
+
},
|
|
43
|
+
crypto_market(refreshCallback) {
|
|
44
|
+
console.clear();
|
|
45
|
+
cryptoMarket();
|
|
46
|
+
setTimeout(refreshCallback, 5e3);
|
|
47
|
+
},
|
|
48
|
+
async bundlephobia_info(refreshCallback) {
|
|
49
|
+
console.clear();
|
|
50
|
+
|
|
51
|
+
const pkgName = await input({
|
|
52
|
+
message: "enter a npm package name for search info size"
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
console.info(pkgName);
|
|
56
|
+
bundlephobia(pkgName);
|
|
57
|
+
setTimeout(refreshCallback, 5e3);
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export default infoTools;
|
package/hash/queryTools.js
CHANGED
|
@@ -1,119 +1,116 @@
|
|
|
1
|
-
// inquirer
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
// functions
|
|
5
|
-
import animeSearch from "../functions/animeInfo.js";
|
|
6
|
-
import movieDB from "../functions/moviesInfo.js";
|
|
7
|
-
import pokemonInfo from "../functions/pokemon.js";
|
|
8
|
-
import twitchInfo from "../functions/twitch.js";
|
|
9
|
-
import deezer from "../functions/deezer.js";
|
|
10
|
-
import potterSearch from "../functions/potterSearch.js";
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
export default queryTools;
|
|
1
|
+
// inquirer
|
|
2
|
+
import { input, password, select, number } from "@inquirer/prompts";
|
|
3
|
+
|
|
4
|
+
// functions
|
|
5
|
+
import animeSearch from "../functions/animeInfo.js";
|
|
6
|
+
import movieDB from "../functions/moviesInfo.js";
|
|
7
|
+
import pokemonInfo from "../functions/pokemon.js";
|
|
8
|
+
import twitchInfo from "../functions/twitch.js";
|
|
9
|
+
import deezer from "../functions/deezer.js";
|
|
10
|
+
import potterSearch from "../functions/potterSearch.js";
|
|
11
|
+
|
|
12
|
+
/** query tools */
|
|
13
|
+
const queryTools = {
|
|
14
|
+
async anime_Search(refreshCallback) {
|
|
15
|
+
console.clear();
|
|
16
|
+
|
|
17
|
+
const query = await input({
|
|
18
|
+
message: "enter a anime keyword for search",
|
|
19
|
+
required: true
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
animeSearch(query);
|
|
23
|
+
setTimeout(refreshCallback, 2e3);
|
|
24
|
+
},
|
|
25
|
+
async movie_info(refreshCallback) {
|
|
26
|
+
console.clear();
|
|
27
|
+
|
|
28
|
+
const { query, token } = {
|
|
29
|
+
query: await input({
|
|
30
|
+
message: "enter movie for search DB",
|
|
31
|
+
required: true
|
|
32
|
+
}),
|
|
33
|
+
token: await password({
|
|
34
|
+
message: "enter a token key",
|
|
35
|
+
required: true,
|
|
36
|
+
mask: true
|
|
37
|
+
})
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
movieDB(query, token);
|
|
41
|
+
setTimeout(refreshCallback, 2e3);
|
|
42
|
+
},
|
|
43
|
+
async pokemon_info(refreshCallback) {
|
|
44
|
+
console.clear();
|
|
45
|
+
|
|
46
|
+
const pokeSelect = await select({
|
|
47
|
+
message: "enter a opt for start search",
|
|
48
|
+
choices: ["id", "name"],
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const opt = pokeSelect === "id"
|
|
52
|
+
? await number({
|
|
53
|
+
message: "enter a poekmon ID:",
|
|
54
|
+
min: 1,
|
|
55
|
+
required: true
|
|
56
|
+
}) : await input({
|
|
57
|
+
message: "enter a poekmon name:",
|
|
58
|
+
required: true,
|
|
59
|
+
validate: input => /[^0-9]/.test(input) || "the pokemon name is required"
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
pokemonInfo(opt);
|
|
63
|
+
setTimeout(refreshCallback, 6e3);
|
|
64
|
+
},
|
|
65
|
+
async twitch_info(refreshCallback) {
|
|
66
|
+
console.clear();
|
|
67
|
+
|
|
68
|
+
const { twitchSeparator, twitchUsers, twitchClient, twitchToken } = {
|
|
69
|
+
twitchSeparator: await input({
|
|
70
|
+
message: "enter a separator for split example ',':",
|
|
71
|
+
required: true
|
|
72
|
+
}),
|
|
73
|
+
twitchUsers: await input({
|
|
74
|
+
message: "enter a twitch users example 'a,b,c'",
|
|
75
|
+
required: true
|
|
76
|
+
}),
|
|
77
|
+
twitchClient: await password({
|
|
78
|
+
message: "enter a twitch client ID:",
|
|
79
|
+
required: true,
|
|
80
|
+
mask: true
|
|
81
|
+
}),
|
|
82
|
+
twitchToken: await password({
|
|
83
|
+
message: "enter a twitch token:",
|
|
84
|
+
required: true,
|
|
85
|
+
mask: true
|
|
86
|
+
})
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
twitchInfo({ twitchSeparator, twitchUsers, twitchClient, twitchToken });
|
|
90
|
+
setTimeout(refreshCallback, 2e3);
|
|
91
|
+
},
|
|
92
|
+
async deezer(refreshCallback) {
|
|
93
|
+
console.clear();
|
|
94
|
+
|
|
95
|
+
const query = await input({
|
|
96
|
+
message: "enter a query for search",
|
|
97
|
+
required: true
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
setTimeout(refreshCallback, 5e3);
|
|
101
|
+
deezer(query);
|
|
102
|
+
},
|
|
103
|
+
async potter_search(refreshCallback) {
|
|
104
|
+
console.clear();
|
|
105
|
+
|
|
106
|
+
const search = await input({
|
|
107
|
+
message: "enter a keyword or name for search",
|
|
108
|
+
required: true
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
potterSearch(search);
|
|
112
|
+
setTimeout(refreshCallback, 5e3);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export default queryTools;
|
package/hash/utilityTools.js
CHANGED
|
@@ -1,19 +1,32 @@
|
|
|
1
|
-
//
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
// menu
|
|
2
|
+
import { stackMenu } from "../menu.js";
|
|
3
|
+
import { pokerGameOpts } from "../utils.js";
|
|
4
|
+
|
|
5
|
+
// functions
|
|
6
|
+
import genPassword from "../functions/password.js";
|
|
7
|
+
import hardware from "../functions/hardware.js";
|
|
8
|
+
import pokerGame from "../functions/poker.js";
|
|
9
|
+
|
|
10
|
+
const utilityTools = {
|
|
11
|
+
password(refreshCallback) {
|
|
12
|
+
console.clear();
|
|
13
|
+
genPassword();
|
|
14
|
+
setTimeout(refreshCallback, 3e3);
|
|
15
|
+
},
|
|
16
|
+
async hardware(refreshCallback) {
|
|
17
|
+
console.clear();
|
|
18
|
+
hardware();
|
|
19
|
+
setTimeout(refreshCallback, 3e3);
|
|
20
|
+
},
|
|
21
|
+
async poker_game(refreshCallback) {
|
|
22
|
+
const pokeOpt = await stackMenu({
|
|
23
|
+
message: "select a poker game for view instructions:",
|
|
24
|
+
choices: pokerGameOpts
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
pokerGame(pokeOpt);
|
|
28
|
+
setTimeout(refreshCallback, 5e3);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default utilityTools;
|