stack-analyze 1.3.5 → 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/hash/infoTools.js CHANGED
@@ -1,61 +1,61 @@
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;
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;
@@ -1,116 +1,116 @@
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;
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;
@@ -1,32 +1,32 @@
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;
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;
@@ -1,59 +1,89 @@
1
- // inquirer
2
- import { select } from "@inquirer/prompts";
3
-
4
- import { wallpaperDownload } from "../functions/download.js";
5
-
6
- const message = "select a wallpaper for download:";
7
- const backMenu = "back to menu";
8
-
9
- const wallpaperSelect = {
10
- async solMoon(refreshCallback, alternativeCallback) {
11
- const solMoonWallpapers = [...Array(20).keys()]
12
- .map(i => `sol-moon${i + 1}.jpeg`);
13
-
14
-
15
- const solMoon = await select({
16
- message, choices: [...solMoonWallpapers, backMenu]
17
- });
18
-
19
- if (solMoon === backMenu) {
20
- alternativeCallback();
21
- } else {
22
- wallpaperDownload("sol-moon", solMoon);
23
- setTimeout(refreshCallback, 5000);
24
- }
25
- },
26
- async dimensions(refreshCallback, alternativeCallback) {
27
- const dimensionsWallpapers = [...Array(12).keys()]
28
- .map(i => `dimensions-${i + 1}.jpeg`);
29
-
30
-
31
- const dimensions = await select({
32
- message, choices: [...dimensionsWallpapers, backMenu]
33
- });
34
-
35
- if(dimensions === backMenu) {
36
- alternativeCallback();
37
- } else {
38
- wallpaperDownload("dimensions", dimensions);
39
- setTimeout(refreshCallback, 5000);
40
- }
41
- },
42
- async seyyahi2(refreshCallback, alternativeCallback) {
43
- const seyyahiWallpapers = [...Array(14).keys()]
44
- .map(i => `seyyahi2-wallpaper${i + 1}.jpg`);
45
-
46
- const seyyahi2 = await select({
47
- message, choices: [...seyyahiWallpapers, backMenu]
48
- });
49
-
50
- if(seyyahi2 === backMenu) {
51
- alternativeCallback();
52
- } else {
53
- wallpaperDownload("seyyahi2", seyyahi2);
54
- setTimeout(refreshCallback, 5000);
55
- }
56
- }
57
- };
58
-
59
- export default wallpaperSelect;
1
+ // inquirer
2
+ import { select } from "@inquirer/prompts";
3
+
4
+ import { wallpaperDownload } from "../functions/download.js";
5
+
6
+ const message = "select a wallpaper for download:";
7
+ const backMenu = "back to menu";
8
+
9
+ const wallpaperSelect = {
10
+ async solMoon(refreshCallback, alternativeCallback) {
11
+ const solMoonWallpapers = [...Array(20).keys()]
12
+ .map(i => `sol-moon${i + 1}.jpeg`);
13
+
14
+
15
+ const solMoon = await select({
16
+ message, choices: [...solMoonWallpapers, backMenu]
17
+ });
18
+
19
+ if (solMoon === backMenu) {
20
+ alternativeCallback();
21
+ } else {
22
+ wallpaperDownload("sol-moon", solMoon);
23
+ setTimeout(refreshCallback, 5000);
24
+ }
25
+ },
26
+ async dimensions(refreshCallback, alternativeCallback) {
27
+ const dimensionsWallpapers = [...Array(12).keys()]
28
+ .map(i => `dimensions-${i + 1}.jpeg`);
29
+
30
+
31
+ const dimensions = await select({
32
+ message, choices: [...dimensionsWallpapers, backMenu]
33
+ });
34
+
35
+ if(dimensions === backMenu) {
36
+ alternativeCallback();
37
+ } else {
38
+ wallpaperDownload("dimensions", dimensions);
39
+ setTimeout(refreshCallback, 5000);
40
+ }
41
+ },
42
+ async seyyahi2(refreshCallback, alternativeCallback) {
43
+ const seyyahiWallpapers = [...Array(14).keys()]
44
+ .map(i => `seyyahi2-wallpaper${i + 1}.jpg`);
45
+
46
+ const seyyahi2 = await select({
47
+ message, choices: [...seyyahiWallpapers, backMenu]
48
+ });
49
+
50
+ if(seyyahi2 === backMenu) {
51
+ alternativeCallback();
52
+ } else {
53
+ wallpaperDownload("seyyahi2", seyyahi2);
54
+ setTimeout(refreshCallback, 5000);
55
+ }
56
+ },
57
+ async ancientMistery(refreshCallback, alternativeCallback) {
58
+ const ancientMisteryWallpapers = [...Array(6).keys()]
59
+ .map(i => `ancient-mistery${i + 1}.jpeg`);
60
+
61
+ const ancientMistery = await select({
62
+ message, choices: [...ancientMisteryWallpapers, backMenu]
63
+ });
64
+
65
+ if(ancientMistery === backMenu) {
66
+ alternativeCallback();
67
+ } else {
68
+ wallpaperDownload("ancient-mistery", ancientMistery);
69
+ setTimeout(refreshCallback, 5000);
70
+ }
71
+ },
72
+ async tsukyNoEmily(refreshCallback, alternativeCallback) {
73
+ const tsukyNoEmilyWallpapers = [...Array(6).keys()]
74
+ .map(i => `tsuky-no-emily${i + 1}.jpeg`);
75
+
76
+ const tsukyNoEmily = await select({
77
+ message, choices: [...tsukyNoEmilyWallpapers, backMenu]
78
+ });
79
+
80
+ if(tsukyNoEmily === backMenu) {
81
+ alternativeCallback();
82
+ } else {
83
+ wallpaperDownload("tsuky-no-emily", tsukyNoEmily);
84
+ setTimeout(refreshCallback, 5000);
85
+ }
86
+ },
87
+ };
88
+
89
+ export default wallpaperSelect;