stack-analyze 1.2.4 → 1.2.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 CHANGED
@@ -2,228 +2,250 @@
2
2
 
3
3
  stack-analyze all version and notable changes, fixed, remove and new additions in code.
4
4
 
5
- ## version 1.2.4
6
- ### Changed
7
- - remove jest module by node:test
8
- - web scraping & github info using native fetch api & not axios
9
- ### fixed
5
+ ## generation 3 (ver. 1.2.0 -)
6
+
7
+ ### version 1.2.6
8
+ #### Changed
9
+ - redesign poke info tool
10
+ - remove module info in readme
11
+
12
+ ### version 1.2.5
13
+ #### Added
14
+ - pokemon info tool.
15
+ #### Changed
16
+ - update script test.
17
+ - remove the cjs and mjs files.
18
+ - renove changelog based in generations similar to neo-jquery.
19
+ #### fixed
20
+ - add examples in twitch info users.
21
+ - fixed the bug create hardware info file.
22
+
23
+ ### version 1.2.4
24
+ #### Changed
25
+ - remove jest module by node:test,
26
+ - web scraping & github info using native fetch api & not axios,
27
+ #### fixed
10
28
  - fixed errors in:
11
- - single stack
12
- - multiple
13
- - hardware information
29
+ - single stack.
30
+ - multiple.
31
+ - hardware information.
14
32
  - single & multiple stack using sub await mode
15
33
 
16
- ## version 1.2.3
17
- ### Added
34
+ ### version 1.2.3
35
+ #### Added
18
36
  - bundlephobia info tool
19
- ### Changed
37
+ #### Changed
20
38
  - change write json to csv in hardware information
21
39
 
22
- ## version 1.2.2
23
- ### Added
40
+ ### version 1.2.2
41
+ #### Added
24
42
  - add save file function for the tools
25
- ### Changed
43
+ #### Changed
26
44
  - change the hash table to unique function in hardware information
27
- ### Fixed
45
+ #### Fixed
28
46
  - fixed to unique user to multiple users with split params
29
47
 
30
- ## version 1.2.1
31
- ### Fixed
48
+ ### version 1.2.1
49
+ #### Fixed
32
50
  - rewrite form arrow functions to named function with export default.
33
51
  - rewrite some test functions.
34
52
  - add regexp form bitly info tool
35
- ### Changed
53
+ #### Changed
36
54
  - renove menu now using categories.
37
55
  - add api params.
38
56
  - comeback multibar from pagespeed tool
39
57
 
40
- ## version 1.2.0
41
- ### Added
58
+ ### version 1.2.0
59
+ #### Added
42
60
  - new tool password generator
43
- ### Fixed
61
+ #### Fixed
44
62
  - update anime search tool
45
63
  - the files modules now using callbacks and remove no using vars
46
- ### Changed
64
+ #### Changed
47
65
  - the web scraping tool decided to use the question returns to the main menu instead of going to the main menu
48
66
 
49
- ## version 1.1.9
50
- ### Added
67
+ ## generation 2 (ver. 1.1.0 - 1.1.9)
68
+
69
+ ### version 1.1.9
70
+ #### Added
51
71
  - new module cheerio
52
72
  - new tool webscraping
53
73
  - new test
54
- ### Fixed
74
+ #### Fixed
55
75
  - rewirte axios import
56
- ### Changed
76
+ #### Changed
57
77
  - hardware information change from functions to hash table
58
78
  - about now is hash table
59
79
  - now using the function printTable avoid overwritting.
60
80
  - remove jsdocs the modules files
61
- ### remove
81
+ #### remove
62
82
  - remove models console-table-printer
63
83
  - remove hash tables
64
84
 
65
- ## version 1.1.8
66
- ### Fixed
85
+ ### version 1.1.8
86
+ #### Fixed
67
87
  - restructure all tools as a hash table with promises except the tool hardware information and about section
68
88
  - update all modules
69
- ### Changed
89
+ #### Changed
70
90
  - remove the module coingecko-api
71
91
  - remove process.env variables to writting manual token for security
72
92
 
73
93
  ## version 1.1.7
74
- ### Added
94
+ #### Added
75
95
  - twitch info tool
76
96
  - remove one js module for module to cjs and esm
77
- ### Fixed
97
+ #### Fixed
78
98
  - change write token to process.env varaibles own (not avalible values in github and gitlab)
79
99
  - migrate cjs to esm
80
100
  - rewrite module
81
- ### Changed
101
+ #### Changed
82
102
  - except some hardware tools and github using models from console-table-printer
83
103
  - now using esm now about is js file not folder about with index.js
84
104
  - rewrite all tests functions
85
105
 
86
- ## version 1.1.6
87
- ### Added
106
+ ### version 1.1.6
107
+ #### Added
88
108
  - module stack-analyze mode
89
- ### Fixed
109
+ #### Fixed
90
110
  - rewrite code
91
- ### Changed
111
+ #### Changed
92
112
  - menu renove
93
113
  - renove jsdocs in some function or variables
94
114
  - remove nonolive recommends soon in versions desktop 7 and pwa 1.5.0
95
115
 
96
- ## version 1.1.5
97
- ### Added
116
+ ### version 1.1.5
117
+ #### Added
98
118
  - add new tool: movie info
99
119
  - add new test
100
120
  - renove menu
101
- ### Fixed
121
+ #### Fixed
102
122
  - rewrite in some functions and about
103
123
  - remove some dependencies not using project
104
- ### Changed
124
+ #### Changed
105
125
  - change multibar to 2 single bars
106
126
  - change switch in all tools for hash functions tables
107
127
  - renove nonolive recommends
108
128
 
109
- ## version 1.1.4
110
- ### Added
129
+ ### version 1.1.4
130
+ #### Added
111
131
  - add new tool: bitly info
112
132
  - add new test
113
- ### Fixed
133
+ #### Fixed
114
134
  - rewrite some functions
115
135
  - update npm modules via manual
116
136
 
117
- ## version 1.1.3
118
- ### Added
137
+ ### version 1.1.3
138
+ #### Added
119
139
  - add new module: coingecko-api
120
140
  - add new tool: crypto market
121
141
  - add new recomends
122
142
  - add new test
123
- ### Fixed
143
+ #### Fixed
124
144
  - rewrite some functions
125
145
  - update npm modules via manual
126
- ### Changed
146
+ #### Changed
127
147
  - add new const variables for map array functions
128
148
 
129
- ## version 1.1.2
130
- ### Added
149
+ ### version 1.1.2
150
+ #### Added
131
151
  - add new nonolive streamers Recomend
132
- ### Fixed
152
+ #### Fixed
133
153
  - rewrite multiple techstack
134
154
  - rewrite test files
135
- ### Changed
155
+ #### Changed
136
156
  - changed the for loop to foreach loop
137
157
 
138
- ## version 1.1.1
139
- ### Added
158
+ ### version 1.1.1
159
+ #### Added
140
160
  - using console.table only in objects variables
141
161
  - using the console-table-printer in arrays in some functions and the about section
142
162
  - add the new module: console-table-printer
143
163
  - add the new nonolive streamers and youtube dev recommedation
144
- ### Fixed
164
+ #### Fixed
145
165
  - rewrite some funcions
146
166
  - fragment about section
147
- ### Changed
167
+ #### Changed
148
168
  - using console.table only in objects variables
149
169
  - using the console-table-printer in arrays in some functions and the about section
150
170
 
151
- ## version 1.1.0
152
- ### Added
171
+ ### version 1.1.0
172
+ #### Added
153
173
  - add the new modules:
154
174
  - systeminformation the main module
155
175
  - jsdoc + the template minami the dev modules
156
176
  - add the hardware information
157
177
  - add new recomendations for about section
158
- ### Fixed
178
+ #### Fixed
159
179
  - rewrite the code the functions singlestack and multiple
160
180
  - add the name app to question function
161
- ### Changed
181
+ #### Changed
162
182
  - changed the node style color to using colors
163
183
 
164
- ## version 1.0.9
165
- ### Added
184
+ ## generation 1 (ver. 1.0.1 - 1.0.9)
185
+
186
+ ### version 1.0.9
187
+ #### Added
166
188
  - add the new modules:
167
189
  - timeago.js for the github user
168
190
  - add the options github info and anime search the main options
169
191
  - add new recomendations for the about section
170
- ### Fixed
192
+ #### Fixed
171
193
  - return the peformance now for pagespeed
172
- ### Changed
194
+ #### Changed
173
195
  - add new testing
174
196
 
175
- ## version 1.0.8
176
- ### Added
197
+ ### version 1.0.8
198
+ #### Added
177
199
  - add the new modules:
178
200
  - colors
179
201
  - cli-progress
180
- ### Fixed
202
+ #### Fixed
181
203
  change json print to table print version
182
- ### Changed
204
+ #### Changed
183
205
  - change console.dir about to console.table
184
206
  - change from text to bar for pagespeed results
185
207
  - add the badge tech stack project
186
- ### patch version 1.0.85
208
+ #### patch version 1.0.85
187
209
  notes:
188
210
  - fixed the cli run
189
211
  - remove performance.now for the defined time in pagespeed
190
212
  - add recomendations sections
191
213
 
192
- ## version 1.0.7
193
- ### Added
214
+ ### version 1.0.7
215
+ #### Added
194
216
  - add the new modules:
195
217
  - figlet the main module
196
218
  - jest dev module and testing functions
197
219
  - add the options page speed and about the main options
198
220
  - add return in a option select except about and exit
199
- ### Fixed
221
+ #### Fixed
200
222
  - the website in blank or website without http:// or https:// return the main options
201
223
  - eslint custom rules without style guide
202
- ### Changed
224
+ #### Changed
203
225
  - changed the inquirer list to inquirer rawlist
204
226
  - rewirte jsdoc in all project except test files
205
227
  - the tech stack using other console methods console.log only in exit cli
206
228
 
207
229
  ## version 1.0.6
208
- ### Added
230
+ #### Added
209
231
  - add the new options: multiple (analyze many sites) and exit (exit cli).
210
232
  - the code was testing with eslint to avoid errors to execute
211
233
  - rewrite the module docs.
212
- ### Changed
234
+ #### Changed
213
235
  - the list options with inquirer
214
236
  - welcome message modified
215
237
 
216
- ## version 1.0.5
217
- ### Changed
238
+ ### version 1.0.5
239
+ #### Changed
218
240
  - modify the code and module structure
219
- ### remove
241
+ #### remove
220
242
  - remove the commander module
221
243
 
222
- ## version 1.0.4
244
+ #### version 1.0.4
223
245
  - fisrt official version in npm with the modules:
224
246
  - wappalyzer
225
247
  - inquirer
226
248
  - commander
227
249
 
228
- ## version 1.0.1 to 1.0.3
250
+ #### version 1.0.1 to 1.0.3
229
251
  test version modules without wappalyzer module (only testing)
package/about.js CHANGED
@@ -46,6 +46,7 @@ const aboutTool = {
46
46
 
47
47
  console.clear();
48
48
  console.table(aboutApp);
49
+
49
50
  setTimeout(refreshCallback, timeout);
50
51
  },
51
52
  lineup(refreshCallback) {
@@ -85,6 +86,10 @@ const aboutTool = {
85
86
  {
86
87
  user: "Lunanny",
87
88
  details: "art director with ADHD."
89
+ },
90
+ {
91
+ user: "Japon_HR",
92
+ details: "cosplayer, gamer, dance & halo machinima creator"
88
93
  }
89
94
  ];
90
95
 
@@ -1,5 +1,4 @@
1
1
  // modules
2
- import axios from "axios";
3
2
  import { format } from "timeago.js";
4
3
  import colors from "colors";
5
4
 
@@ -10,10 +10,6 @@ import {
10
10
  } from "systeminformation";
11
11
  import colors from "colors";
12
12
 
13
- import { stackSave } from "../utils.js";
14
-
15
- const hardwareinfo = createWriteStream("hardware.csv");
16
-
17
13
  const csvHeader = (obj) => `${Object.keys(obj).join(";")}\n`;
18
14
  const csvData = (obj, spaces) => `${Object.values(obj).join(";")}${spaces}`;
19
15
 
@@ -32,6 +28,8 @@ const gigabyteConvert = (size, base = 1073741824) => (size / base).toFixed(2);
32
28
  */
33
29
  export default async function hardware() {
34
30
  try {
31
+ const hardwareinfo = createWriteStream("hardware.csv");
32
+
35
33
  // bios info
36
34
  const biosInfo = await bios();
37
35
 
@@ -20,5 +20,5 @@ export default function genPassword() {
20
20
 
21
21
  // print new passwors
22
22
  console.info("new password:", password);
23
- stackSave("password.txt", `new password: ${password}`)
23
+ stackSave("password.txt", `new password: ${password}`);
24
24
  }
@@ -0,0 +1,106 @@
1
+ // colors
2
+ import colors from "colors";
3
+ import boxen from "boxen";
4
+ import CliProgress from "cli-progress";
5
+
6
+ // utils
7
+ import { listFormat, stackSave } from "../utils.js";
8
+
9
+ const pokeStats = {
10
+ hp: 255,
11
+ attack: 194,
12
+ defense: 230,
13
+ "special-attack": 180,
14
+ "special-defense": 230,
15
+ speed: 200,
16
+ xp: 635
17
+ };
18
+
19
+ /**
20
+ * @param {string}
21
+ * @returns {string}
22
+ */
23
+ const barColor = stat => {
24
+ switch(stat) {
25
+ case "hp":
26
+ return "{bar}".red;
27
+ case "attack":
28
+ return "{bar}".yellow;
29
+ case "defense":
30
+ return "{bar}".brightYellow;
31
+ case "special-attack":
32
+ return "{bar}".blue;
33
+ case "special-defense":
34
+ return "{bar}".green;
35
+ case "speed":
36
+ return "{bar}".magenta;
37
+ default:
38
+ return "{bar}".cyan;
39
+ }
40
+ };
41
+
42
+ /**
43
+ * @async
44
+ * @param {number | string} pokemon
45
+ * @returns {Promise<void>}
46
+ */
47
+ export default async function pokemonInfo(pokemon) {
48
+ console.clear();
49
+
50
+ const multibar = new CliProgress.MultiBar({
51
+ format: "{stats} | {bar} | {value}/{total}",
52
+ clearOnComplete: false,
53
+ stopOnComplete: true,
54
+ hideCursor: true,
55
+ forceRedraw: true,
56
+ }, CliProgress.Presets.shades_grey);
57
+
58
+ try {
59
+ const data = await (
60
+ await fetch(`https://pokeapi.co/api/v2/pokemon/${pokemon}`)
61
+ ).json();
62
+
63
+ const {
64
+ id,
65
+ name,
66
+ height,
67
+ base_experience,
68
+ weight,
69
+ stats,
70
+ types
71
+ } = data;
72
+
73
+ const info = {
74
+ id,
75
+ name,
76
+ height,
77
+ base_experience,
78
+ weight,
79
+ types: listFormat.format(types.map(({ type }) => type.name)),
80
+ };
81
+
82
+ const PokeInfo = boxen(info.types, {title: `${id} - ${name}`});
83
+
84
+ multibar.create(pokeStats.xp, 0, { stats: "xp" }, {
85
+ format: `{stats} | ${barColor("xp")} | {value}/{total}`,
86
+ }).update(base_experience);
87
+
88
+ stats.forEach(({base_stat, stat}) => {
89
+ multibar.create(pokeStats[stat.name], 0, { stats: stat.name }, {
90
+ format: `{stats} | ${barColor(stat.name)} | {value}/{total}`,
91
+ }).update(base_stat);
92
+
93
+ info[stat.name] = base_stat;
94
+ });
95
+
96
+ multibar.log(`${PokeInfo}\n`);
97
+
98
+ setTimeout(() => {
99
+ multibar.stop();
100
+ }, 3000);
101
+
102
+ stackSave("poke-info.json", JSON.stringify(info, null, 2));
103
+ } catch(err) {
104
+ console.info(colors.red(err.message));
105
+ }
106
+ }
@@ -100,7 +100,7 @@ export default async function scrape(url, options) {
100
100
  })).toArray()
101
101
  .filter(({ url }) => url.indexOf("#") !== 0);
102
102
 
103
- result = linkList
103
+ result = linkList;
104
104
 
105
105
  printTable(linkList);
106
106
  },
@@ -124,8 +124,8 @@ export default async function scrape(url, options) {
124
124
  scraping[options]();
125
125
 
126
126
  typeof result === "string"
127
- ? stackSave('scraping.txt', result)
128
- : stackSave('scraping.json', JSON.stringify(result, null, 2));
127
+ ? stackSave("scraping.txt", result)
128
+ : stackSave("scraping.json", JSON.stringify(result, null, 2));
129
129
  } catch (err) {
130
130
  console.error(colors.red(err.message));
131
131
  }
package/hash/infoTools.js CHANGED
@@ -47,7 +47,7 @@ const infoTools = {
47
47
  promptParams("pkgName", "enter a npm package name for search info size")
48
48
  ])
49
49
  .then(({ pkgName }) => {
50
- console.info(pkgName)
50
+ console.info(pkgName);
51
51
  bundlephobia(pkgName);
52
52
  setTimeout(refreshCallback, 2e3);
53
53
  });
@@ -4,6 +4,7 @@ import inquirer from "inquirer";
4
4
  // functions
5
5
  import animeSearch from "../functions/animeInfo.js";
6
6
  import movieDB from "../functions/moviesInfo.js";
7
+ import pokemonInfo from "../functions/pokemon.js";
7
8
  import twitchInfo from "../functions/twitch.js";
8
9
 
9
10
  // fields
@@ -14,7 +15,6 @@ import {
14
15
 
15
16
  /** query tools */
16
17
  const queryTools = {
17
-
18
18
  anime_Search(refreshCallback) {
19
19
  console.clear();
20
20
  inquirer.prompt([promptParams("query", "")])
@@ -34,11 +34,53 @@ const queryTools = {
34
34
  setTimeout(refreshCallback, 2e3);
35
35
  });
36
36
  },
37
+ pokemon_info(refreshCallback) {
38
+ console.clear();
39
+ inquirer.prompt([
40
+ {
41
+ type: "list",
42
+ name: "pokeOpt",
43
+ message: "enter a opt for start search",
44
+ choices: ["ID", "Name"],
45
+ },
46
+ {
47
+ type: "number",
48
+ name: "pokeId",
49
+ message: "enter a poekmon ID:",
50
+ validate: value => value > 0 || "this field not allowed empty values, NaN or number less or equal to 0",
51
+ filter(value) {
52
+ if(!value) return "";
53
+
54
+ const int = parseInt(value);
55
+
56
+ if(isNaN(int)) return "";
57
+
58
+ return int <= 0 ? "" : int;
59
+ },
60
+ when: ({pokeOpt}) => pokeOpt === "ID",
61
+ },
62
+ {
63
+ type: "input",
64
+ name: "pokeName",
65
+ message: "enter a poekmon name:",
66
+ validate(input) {
67
+ const excludeNumbers = /[^0-9]/;
68
+
69
+ return excludeNumbers.test(input) || "the pokemon name is required";
70
+ },
71
+ when: ({pokeOpt}) => pokeOpt === "Name",
72
+ },
73
+ ])
74
+ .then(anw => {
75
+ pokemonInfo(anw?.pokeName || anw?.pokeId);
76
+ setTimeout(refreshCallback, 6e3);
77
+ });
78
+ },
37
79
  twitch_info(refreshCallback) {
38
80
  console.clear();
39
81
  inquirer.prompt([
40
- promptParams("twitchSeparator", "enter a separator for split"),
41
- promptParams("twitchUsers", "enter a twitch user"),
82
+ promptParams("twitchSeparator", "enter a separator for split example ',':"),
83
+ promptParams("twitchUsers", "enter a twitch users example 'a,b,c'"),
42
84
  promptKey("twitchClient", "enter a twitch client ID"),
43
85
  promptKey("twitchToken", "enter a twitch token"),
44
86
  ])
@@ -2,8 +2,6 @@
2
2
  import genPassword from "../functions/password.js";
3
3
  import hardware from "../functions/hardware.js";
4
4
 
5
- // opts
6
- import { menuHardwareOpts } from "../utils.js";
7
5
 
8
6
  const utilityTools = {
9
7
  password(refreshCallback) {
package/package.json CHANGED
@@ -1,39 +1,34 @@
1
1
  {
2
2
  "name": "stack-analyze",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "type": "module",
5
5
  "description": "cli tech stack analyze and pagespeed with node.js using the wappalyzer module. with google pagespeed api, hardware and crypto market",
6
6
  "main": "index.mjs",
7
7
  "bin": {
8
8
  "stack-analyze": "cli.js"
9
9
  },
10
- "exports": {
11
- ".": {
12
- "require": "./index.cjs",
13
- "import": "./index.mjs"
14
- }
15
- },
16
10
  "dependencies": {
17
- "axios": "^1.4.0",
11
+ "axios": "^1.5.0",
12
+ "boxen": "^7.1.1",
18
13
  "cheerio": "^1.0.0-rc.12",
19
14
  "cli-progress": "^3.12.0",
20
15
  "colors": "^1.4.0",
21
- "console-table-printer": "^2.11.1",
16
+ "console-table-printer": "^2.11.2",
22
17
  "figlet": "^1.6.0",
23
18
  "gauge": "^5.0.1",
24
- "inquirer": "^9.2.0",
25
- "systeminformation": "^5.17.12",
19
+ "inquirer": "^9.2.10",
20
+ "systeminformation": "^5.21.3",
26
21
  "timeago.js": "^4.0.2",
27
- "wappalyzer": "^6.10.62"
22
+ "wappalyzer": "^6.10.63"
28
23
  },
29
24
  "devDependencies": {
30
- "eslint": "^8.39.0",
31
- "gh-pages": "^5.0.0",
25
+ "eslint": "^8.48.0",
26
+ "gh-pages": "^6.0.0",
32
27
  "jsdoc": "^4.0.2"
33
28
  },
34
29
  "scripts": {
35
30
  "start": "node cli.js",
36
- "test": "jest",
31
+ "test": "node --test test/index.test.js",
37
32
  "lint:test": "eslint . --ext .js,.cjs,.mjs",
38
33
  "lint:fix": "eslint . --ext .js,.cjs,.mjs --fix",
39
34
  "docs": "jsdoc -c jsdoc.json",