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/cli.js
CHANGED
|
@@ -1,227 +1,213 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import Gauge from "gauge";
|
|
3
|
-
import colors from "colors";
|
|
4
|
-
import
|
|
5
|
-
import figlet from "figlet";
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
import
|
|
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
|
-
message: "enter a web tool option",
|
|
44
|
-
choices: menuWebOpts
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
web !== "return main menu"
|
|
48
|
-
? webTools[web](returnMain)
|
|
49
|
-
: mainMenu();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* @async
|
|
54
|
-
* @returns {Promise<void>}
|
|
55
|
-
*/
|
|
56
|
-
async function infoOpts() {
|
|
57
|
-
console.info(colors.yellow(figlet.textSync("info options")));
|
|
58
|
-
|
|
59
|
-
const
|
|
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
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
console.clear();
|
|
170
|
-
|
|
171
|
-
},
|
|
172
|
-
|
|
173
|
-
console.clear();
|
|
174
|
-
|
|
175
|
-
},
|
|
176
|
-
|
|
177
|
-
console.clear();
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
for (let i = 50; i < totalTime; i += 50) {
|
|
216
|
-
const percentage = i / totalTime;
|
|
217
|
-
|
|
218
|
-
setTimeout(() => {
|
|
219
|
-
gauge.pulse();
|
|
220
|
-
gauge.show(`Loading app... ${percentage * 100}%`.random, percentage);
|
|
221
|
-
}, i);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
setTimeout(() => {
|
|
225
|
-
gauge.hide();
|
|
226
|
-
mainMenu();
|
|
227
|
-
}, totalTime);
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import Gauge from "gauge";
|
|
3
|
+
import colors from "colors";
|
|
4
|
+
import { confirm } from "@inquirer/prompts";
|
|
5
|
+
import figlet from "figlet";
|
|
6
|
+
|
|
7
|
+
import { stackMenu } from "./menu.js";
|
|
8
|
+
|
|
9
|
+
import webTools from "./hash/webTools.js";
|
|
10
|
+
import queryTools from "./hash/queryTools.js";
|
|
11
|
+
import infoTools from "./hash/infoTools.js";
|
|
12
|
+
import utilityTools from "./hash/utilityTools.js";
|
|
13
|
+
import wallpaperSelect from "./hash/wallpaperSelect.js";
|
|
14
|
+
import aboutTool from "./about.js";
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
menuOpts,
|
|
18
|
+
menuQueryOpts,
|
|
19
|
+
menuWebOpts,
|
|
20
|
+
menuAboutOpts,
|
|
21
|
+
menuInfoOpts,
|
|
22
|
+
menuWallpaperOpts,
|
|
23
|
+
menuUtilityOpts
|
|
24
|
+
} from "./utils.js";
|
|
25
|
+
|
|
26
|
+
const [gauge, totalTime, pageSize] = [new Gauge(), 1e4, 9];
|
|
27
|
+
|
|
28
|
+
/** @returns {void} */
|
|
29
|
+
const exitCli = () => {
|
|
30
|
+
console.clear();
|
|
31
|
+
console.info("thanks for use stack-analyze".green);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @async
|
|
36
|
+
* @returns {Promise<void>}
|
|
37
|
+
*/
|
|
38
|
+
async function webOpts() {
|
|
39
|
+
console.info(colors.yellow(figlet.textSync("web options")));
|
|
40
|
+
|
|
41
|
+
const web = await stackMenu({
|
|
42
|
+
pageSize,
|
|
43
|
+
message: "enter a web tool option",
|
|
44
|
+
choices: menuWebOpts
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
web !== "return main menu"
|
|
48
|
+
? webTools[web](returnMain)
|
|
49
|
+
: mainMenu();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @async
|
|
54
|
+
* @returns {Promise<void>}
|
|
55
|
+
*/
|
|
56
|
+
async function infoOpts() {
|
|
57
|
+
console.info(colors.yellow(figlet.textSync("info options")));
|
|
58
|
+
|
|
59
|
+
const info = await stackMenu({
|
|
60
|
+
pageSize,
|
|
61
|
+
message: "enter a info tool option",
|
|
62
|
+
choices: menuInfoOpts
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
info === "return main menu"
|
|
66
|
+
? mainMenu()
|
|
67
|
+
: infoTools[info](returnMain);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @async
|
|
72
|
+
* @returns {Promise<void>}
|
|
73
|
+
*/
|
|
74
|
+
async function queryOpts() {
|
|
75
|
+
console.info(colors.yellow(figlet.textSync("query options")));
|
|
76
|
+
|
|
77
|
+
const query = await stackMenu({
|
|
78
|
+
pageSize,
|
|
79
|
+
message: "enter a query tool option",
|
|
80
|
+
choices: menuQueryOpts
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
query === "return main menu"
|
|
84
|
+
? mainMenu()
|
|
85
|
+
: queryTools[query](returnMain);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @async
|
|
90
|
+
* @returns {Promise<void>}
|
|
91
|
+
*/
|
|
92
|
+
async function wallpapersOpts() {
|
|
93
|
+
console.info(colors.yellow(figlet.textSync("wallpapers")));
|
|
94
|
+
|
|
95
|
+
const wallpaper = await stackMenu({
|
|
96
|
+
pageSize,
|
|
97
|
+
message: "enter a wallpaper selector",
|
|
98
|
+
choices: menuWallpaperOpts
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
wallpaper === "return main menu"
|
|
102
|
+
? mainMenu()
|
|
103
|
+
: wallpaperSelect[wallpaper](returnMain, wallpapersOpts);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @async
|
|
108
|
+
* @returns {Promise<void>}
|
|
109
|
+
*/
|
|
110
|
+
async function utilityOpts() {
|
|
111
|
+
console.info(colors.yellow(figlet.textSync("utility options")));
|
|
112
|
+
|
|
113
|
+
const utility = await stackMenu({
|
|
114
|
+
pageSize,
|
|
115
|
+
message: "enter a utility tool option",
|
|
116
|
+
choices: menuUtilityOpts
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
utility === "return main menu"
|
|
120
|
+
? mainMenu()
|
|
121
|
+
: utilityTools[utility](returnMain);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @async
|
|
126
|
+
* @returns {Promise<void>}
|
|
127
|
+
*/
|
|
128
|
+
async function aboutOpts() {
|
|
129
|
+
console.info(colors.yellow(figlet.textSync("About Menu")));
|
|
130
|
+
|
|
131
|
+
const about = await stackMenu({
|
|
132
|
+
pageSize,
|
|
133
|
+
message: "select about option info",
|
|
134
|
+
choices: menuAboutOpts
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
about !== "return main menu"
|
|
138
|
+
? aboutTool[about](aboutOpts)
|
|
139
|
+
: mainMenu();
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* @async
|
|
144
|
+
* @returns {Promise<void>}
|
|
145
|
+
*/
|
|
146
|
+
async function mainMenu() {
|
|
147
|
+
console.clear();
|
|
148
|
+
console.info(colors.yellow(figlet.textSync("stack-analyze")));
|
|
149
|
+
|
|
150
|
+
const option = await stackMenu({
|
|
151
|
+
message: "what option do you want to analyze stack",
|
|
152
|
+
choices: menuOpts
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
const menuList = {
|
|
156
|
+
web() {
|
|
157
|
+
console.clear();
|
|
158
|
+
webOpts();
|
|
159
|
+
},
|
|
160
|
+
info() {
|
|
161
|
+
console.clear();
|
|
162
|
+
infoOpts();
|
|
163
|
+
},
|
|
164
|
+
query() {
|
|
165
|
+
console.clear();
|
|
166
|
+
queryOpts();
|
|
167
|
+
},
|
|
168
|
+
utility() {
|
|
169
|
+
console.clear();
|
|
170
|
+
utilityOpts();
|
|
171
|
+
},
|
|
172
|
+
wallpapers() {
|
|
173
|
+
console.clear();
|
|
174
|
+
wallpapersOpts();
|
|
175
|
+
},
|
|
176
|
+
about() {
|
|
177
|
+
console.clear();
|
|
178
|
+
aboutOpts();
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
option !== "exit" ? menuList[option]() : exitCli();
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* @async
|
|
187
|
+
* @returns {Promise<void>}
|
|
188
|
+
*/
|
|
189
|
+
async function returnMain() {
|
|
190
|
+
try {
|
|
191
|
+
const returnMain = await confirm({
|
|
192
|
+
message: "do you want go to the main menu?",
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
returnMain ? mainMenu() : exitCli();
|
|
196
|
+
} catch (err) {
|
|
197
|
+
console.error(colors.bgRed(err.message));
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
for (let i = 50; i < totalTime; i += 50) {
|
|
202
|
+
const percentage = i / totalTime;
|
|
203
|
+
|
|
204
|
+
setTimeout(() => {
|
|
205
|
+
gauge.pulse();
|
|
206
|
+
gauge.show(`Loading app... ${percentage * 100}%`.random, percentage);
|
|
207
|
+
}, i);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
setTimeout(() => {
|
|
211
|
+
gauge.hide();
|
|
212
|
+
mainMenu();
|
|
213
|
+
}, totalTime);
|
package/eslint.config.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { fileURLToPath } from "node:url";
|
|
3
|
-
import globals from "globals";
|
|
4
|
-
import js from "@eslint/js";
|
|
5
|
-
import { FlatCompat } from "@eslint/eslintrc";
|
|
6
|
-
|
|
7
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
-
const __dirname = path.dirname(__filename);
|
|
9
|
-
const compat = new FlatCompat({
|
|
10
|
-
baseDirectory: __dirname,
|
|
11
|
-
recommendedConfig: js.configs.recommended,
|
|
12
|
-
allConfig: js.configs.all
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
export default [{
|
|
16
|
-
ignores: ["node_modules", "test", "docs", "eslint.config.js"],
|
|
17
|
-
}, ...compat.extends("eslint:recommended"), {
|
|
18
|
-
languageOptions: {
|
|
19
|
-
globals: {
|
|
20
|
-
...globals.commonjs,
|
|
21
|
-
...globals.node,
|
|
22
|
-
},
|
|
23
|
-
ecmaVersion: "latest",
|
|
24
|
-
sourceType: "module",
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
rules: {
|
|
28
|
-
"no-var": "error",
|
|
29
|
-
eqeqeq: "warn",
|
|
30
|
-
"default-case": "error",
|
|
31
|
-
"eol-last": "error",
|
|
32
|
-
"spaced-comment": "error",
|
|
33
|
-
"comma-spacing": "error",
|
|
34
|
-
quotes: "error",
|
|
35
|
-
"block-spacing": "error",
|
|
36
|
-
"prefer-const": "error",
|
|
37
|
-
|
|
38
|
-
indent: ["error", 2, {
|
|
39
|
-
SwitchCase: 1,
|
|
40
|
-
}],
|
|
41
|
-
|
|
42
|
-
semi: "error",
|
|
43
|
-
},
|
|
44
|
-
}];
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import globals from "globals";
|
|
4
|
+
import js from "@eslint/js";
|
|
5
|
+
import { FlatCompat } from "@eslint/eslintrc";
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = path.dirname(__filename);
|
|
9
|
+
const compat = new FlatCompat({
|
|
10
|
+
baseDirectory: __dirname,
|
|
11
|
+
recommendedConfig: js.configs.recommended,
|
|
12
|
+
allConfig: js.configs.all
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export default [{
|
|
16
|
+
ignores: ["node_modules", "test", "docs", "eslint.config.js"],
|
|
17
|
+
}, ...compat.extends("eslint:recommended"), {
|
|
18
|
+
languageOptions: {
|
|
19
|
+
globals: {
|
|
20
|
+
...globals.commonjs,
|
|
21
|
+
...globals.node,
|
|
22
|
+
},
|
|
23
|
+
ecmaVersion: "latest",
|
|
24
|
+
sourceType: "module",
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
rules: {
|
|
28
|
+
"no-var": "error",
|
|
29
|
+
eqeqeq: "warn",
|
|
30
|
+
"default-case": "error",
|
|
31
|
+
"eol-last": "error",
|
|
32
|
+
"spaced-comment": "error",
|
|
33
|
+
"comma-spacing": "error",
|
|
34
|
+
quotes: "error",
|
|
35
|
+
"block-spacing": "error",
|
|
36
|
+
"prefer-const": "error",
|
|
37
|
+
|
|
38
|
+
indent: ["error", 2, {
|
|
39
|
+
SwitchCase: 1,
|
|
40
|
+
}],
|
|
41
|
+
|
|
42
|
+
semi: "error",
|
|
43
|
+
},
|
|
44
|
+
}];
|
package/functions/animeInfo.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
// modules
|
|
2
|
-
import axios from "axios";
|
|
3
|
-
import { format } from "timeago.js";
|
|
4
|
-
import colors from "colors";
|
|
5
|
-
import { printTable } from "console-table-printer";
|
|
6
|
-
|
|
7
|
-
// save anime
|
|
8
|
-
import { stackSave } from "../utils.js";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
*
|
|
12
|
-
* @description call the anime serach info
|
|
13
|
-
* @async
|
|
14
|
-
* @param { string } q - get query results
|
|
15
|
-
* @returns { Promise<void> } - return results serach
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
export default async function animeSearch(q) {
|
|
19
|
-
try {
|
|
20
|
-
// call api
|
|
21
|
-
const { data } = await axios.get("https://api.jikan.moe/v4/anime", {
|
|
22
|
-
params: { q }
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
const animeData = data.data.map(({
|
|
26
|
-
title,
|
|
27
|
-
episodes,
|
|
28
|
-
aired,
|
|
29
|
-
status,
|
|
30
|
-
type }) => ({
|
|
31
|
-
title,
|
|
32
|
-
type,
|
|
33
|
-
totalEpisodes: episodes || "current",
|
|
34
|
-
debutDate: format(aired.from),
|
|
35
|
-
finalDate: aired?.to
|
|
36
|
-
? format(aired.to)
|
|
37
|
-
: status
|
|
38
|
-
}));
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
printTable(animeData.slice(0, 10));
|
|
42
|
-
|
|
43
|
-
stackSave(`${q}-results.json`, JSON.stringify(animeData, null, 2));
|
|
44
|
-
} catch (err) { console.error(colors.red(err.message)); }
|
|
45
|
-
}
|
|
1
|
+
// modules
|
|
2
|
+
import axios from "axios";
|
|
3
|
+
import { format } from "timeago.js";
|
|
4
|
+
import colors from "colors";
|
|
5
|
+
import { printTable } from "console-table-printer";
|
|
6
|
+
|
|
7
|
+
// save anime
|
|
8
|
+
import { stackSave } from "../utils.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @description call the anime serach info
|
|
13
|
+
* @async
|
|
14
|
+
* @param { string } q - get query results
|
|
15
|
+
* @returns { Promise<void> } - return results serach
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
export default async function animeSearch(q) {
|
|
19
|
+
try {
|
|
20
|
+
// call api
|
|
21
|
+
const { data } = await axios.get("https://api.jikan.moe/v4/anime", {
|
|
22
|
+
params: { q }
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const animeData = data.data.map(({
|
|
26
|
+
title,
|
|
27
|
+
episodes,
|
|
28
|
+
aired,
|
|
29
|
+
status,
|
|
30
|
+
type }) => ({
|
|
31
|
+
title,
|
|
32
|
+
type,
|
|
33
|
+
totalEpisodes: episodes || "current",
|
|
34
|
+
debutDate: format(aired.from),
|
|
35
|
+
finalDate: aired?.to
|
|
36
|
+
? format(aired.to)
|
|
37
|
+
: status
|
|
38
|
+
}));
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
printTable(animeData.slice(0, 10));
|
|
42
|
+
|
|
43
|
+
stackSave(`${q}-results.json`, JSON.stringify(animeData, null, 2));
|
|
44
|
+
} catch (err) { console.error(colors.red(err.message)); }
|
|
45
|
+
}
|