stack-analyze 1.2.4 → 1.2.5

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,245 @@
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.5
8
+ #### Added
9
+ - pokemon info tool.
10
+ #### Changed
11
+ - update script test.
12
+ - remove the cjs and mjs files.
13
+ - renove changelog based in generations similar to neo-jquery.
14
+ #### fixed
15
+ - add examples in twitch info users.
16
+ - fixed the bug create hardware info file.
17
+
18
+ ### version 1.2.4
19
+ #### Changed
20
+ - remove jest module by node:test,
21
+ - web scraping & github info using native fetch api & not axios,
22
+ #### fixed
10
23
  - fixed errors in:
11
- - single stack
12
- - multiple
13
- - hardware information
24
+ - single stack.
25
+ - multiple.
26
+ - hardware information.
14
27
  - single & multiple stack using sub await mode
15
28
 
16
- ## version 1.2.3
17
- ### Added
29
+ ### version 1.2.3
30
+ #### Added
18
31
  - bundlephobia info tool
19
- ### Changed
32
+ #### Changed
20
33
  - change write json to csv in hardware information
21
34
 
22
- ## version 1.2.2
23
- ### Added
35
+ ### version 1.2.2
36
+ #### Added
24
37
  - add save file function for the tools
25
- ### Changed
38
+ #### Changed
26
39
  - change the hash table to unique function in hardware information
27
- ### Fixed
40
+ #### Fixed
28
41
  - fixed to unique user to multiple users with split params
29
42
 
30
- ## version 1.2.1
31
- ### Fixed
43
+ ### version 1.2.1
44
+ #### Fixed
32
45
  - rewrite form arrow functions to named function with export default.
33
46
  - rewrite some test functions.
34
47
  - add regexp form bitly info tool
35
- ### Changed
48
+ #### Changed
36
49
  - renove menu now using categories.
37
50
  - add api params.
38
51
  - comeback multibar from pagespeed tool
39
52
 
40
- ## version 1.2.0
41
- ### Added
53
+ ### version 1.2.0
54
+ #### Added
42
55
  - new tool password generator
43
- ### Fixed
56
+ #### Fixed
44
57
  - update anime search tool
45
58
  - the files modules now using callbacks and remove no using vars
46
- ### Changed
59
+ #### Changed
47
60
  - the web scraping tool decided to use the question returns to the main menu instead of going to the main menu
48
61
 
49
- ## version 1.1.9
50
- ### Added
62
+ ## generation 2 (ver. 1.1.0 - 1.1.9)
63
+
64
+ ### version 1.1.9
65
+ #### Added
51
66
  - new module cheerio
52
67
  - new tool webscraping
53
68
  - new test
54
- ### Fixed
69
+ #### Fixed
55
70
  - rewirte axios import
56
- ### Changed
71
+ #### Changed
57
72
  - hardware information change from functions to hash table
58
73
  - about now is hash table
59
74
  - now using the function printTable avoid overwritting.
60
75
  - remove jsdocs the modules files
61
- ### remove
76
+ #### remove
62
77
  - remove models console-table-printer
63
78
  - remove hash tables
64
79
 
65
- ## version 1.1.8
66
- ### Fixed
80
+ ### version 1.1.8
81
+ #### Fixed
67
82
  - restructure all tools as a hash table with promises except the tool hardware information and about section
68
83
  - update all modules
69
- ### Changed
84
+ #### Changed
70
85
  - remove the module coingecko-api
71
86
  - remove process.env variables to writting manual token for security
72
87
 
73
88
  ## version 1.1.7
74
- ### Added
89
+ #### Added
75
90
  - twitch info tool
76
91
  - remove one js module for module to cjs and esm
77
- ### Fixed
92
+ #### Fixed
78
93
  - change write token to process.env varaibles own (not avalible values in github and gitlab)
79
94
  - migrate cjs to esm
80
95
  - rewrite module
81
- ### Changed
96
+ #### Changed
82
97
  - except some hardware tools and github using models from console-table-printer
83
98
  - now using esm now about is js file not folder about with index.js
84
99
  - rewrite all tests functions
85
100
 
86
- ## version 1.1.6
87
- ### Added
101
+ ### version 1.1.6
102
+ #### Added
88
103
  - module stack-analyze mode
89
- ### Fixed
104
+ #### Fixed
90
105
  - rewrite code
91
- ### Changed
106
+ #### Changed
92
107
  - menu renove
93
108
  - renove jsdocs in some function or variables
94
109
  - remove nonolive recommends soon in versions desktop 7 and pwa 1.5.0
95
110
 
96
- ## version 1.1.5
97
- ### Added
111
+ ### version 1.1.5
112
+ #### Added
98
113
  - add new tool: movie info
99
114
  - add new test
100
115
  - renove menu
101
- ### Fixed
116
+ #### Fixed
102
117
  - rewrite in some functions and about
103
118
  - remove some dependencies not using project
104
- ### Changed
119
+ #### Changed
105
120
  - change multibar to 2 single bars
106
121
  - change switch in all tools for hash functions tables
107
122
  - renove nonolive recommends
108
123
 
109
- ## version 1.1.4
110
- ### Added
124
+ ### version 1.1.4
125
+ #### Added
111
126
  - add new tool: bitly info
112
127
  - add new test
113
- ### Fixed
128
+ #### Fixed
114
129
  - rewrite some functions
115
130
  - update npm modules via manual
116
131
 
117
- ## version 1.1.3
118
- ### Added
132
+ ### version 1.1.3
133
+ #### Added
119
134
  - add new module: coingecko-api
120
135
  - add new tool: crypto market
121
136
  - add new recomends
122
137
  - add new test
123
- ### Fixed
138
+ #### Fixed
124
139
  - rewrite some functions
125
140
  - update npm modules via manual
126
- ### Changed
141
+ #### Changed
127
142
  - add new const variables for map array functions
128
143
 
129
- ## version 1.1.2
130
- ### Added
144
+ ### version 1.1.2
145
+ #### Added
131
146
  - add new nonolive streamers Recomend
132
- ### Fixed
147
+ #### Fixed
133
148
  - rewrite multiple techstack
134
149
  - rewrite test files
135
- ### Changed
150
+ #### Changed
136
151
  - changed the for loop to foreach loop
137
152
 
138
- ## version 1.1.1
139
- ### Added
153
+ ### version 1.1.1
154
+ #### Added
140
155
  - using console.table only in objects variables
141
156
  - using the console-table-printer in arrays in some functions and the about section
142
157
  - add the new module: console-table-printer
143
158
  - add the new nonolive streamers and youtube dev recommedation
144
- ### Fixed
159
+ #### Fixed
145
160
  - rewrite some funcions
146
161
  - fragment about section
147
- ### Changed
162
+ #### Changed
148
163
  - using console.table only in objects variables
149
164
  - using the console-table-printer in arrays in some functions and the about section
150
165
 
151
- ## version 1.1.0
152
- ### Added
166
+ ### version 1.1.0
167
+ #### Added
153
168
  - add the new modules:
154
169
  - systeminformation the main module
155
170
  - jsdoc + the template minami the dev modules
156
171
  - add the hardware information
157
172
  - add new recomendations for about section
158
- ### Fixed
173
+ #### Fixed
159
174
  - rewrite the code the functions singlestack and multiple
160
175
  - add the name app to question function
161
- ### Changed
176
+ #### Changed
162
177
  - changed the node style color to using colors
163
178
 
164
- ## version 1.0.9
165
- ### Added
179
+ ## generation 1 (ver. 1.0.1 - 1.0.9)
180
+
181
+ ### version 1.0.9
182
+ #### Added
166
183
  - add the new modules:
167
184
  - timeago.js for the github user
168
185
  - add the options github info and anime search the main options
169
186
  - add new recomendations for the about section
170
- ### Fixed
187
+ #### Fixed
171
188
  - return the peformance now for pagespeed
172
- ### Changed
189
+ #### Changed
173
190
  - add new testing
174
191
 
175
- ## version 1.0.8
176
- ### Added
192
+ ### version 1.0.8
193
+ #### Added
177
194
  - add the new modules:
178
195
  - colors
179
196
  - cli-progress
180
- ### Fixed
197
+ #### Fixed
181
198
  change json print to table print version
182
- ### Changed
199
+ #### Changed
183
200
  - change console.dir about to console.table
184
201
  - change from text to bar for pagespeed results
185
202
  - add the badge tech stack project
186
- ### patch version 1.0.85
203
+ #### patch version 1.0.85
187
204
  notes:
188
205
  - fixed the cli run
189
206
  - remove performance.now for the defined time in pagespeed
190
207
  - add recomendations sections
191
208
 
192
- ## version 1.0.7
193
- ### Added
209
+ ### version 1.0.7
210
+ #### Added
194
211
  - add the new modules:
195
212
  - figlet the main module
196
213
  - jest dev module and testing functions
197
214
  - add the options page speed and about the main options
198
215
  - add return in a option select except about and exit
199
- ### Fixed
216
+ #### Fixed
200
217
  - the website in blank or website without http:// or https:// return the main options
201
218
  - eslint custom rules without style guide
202
- ### Changed
219
+ #### Changed
203
220
  - changed the inquirer list to inquirer rawlist
204
221
  - rewirte jsdoc in all project except test files
205
222
  - the tech stack using other console methods console.log only in exit cli
206
223
 
207
224
  ## version 1.0.6
208
- ### Added
225
+ #### Added
209
226
  - add the new options: multiple (analyze many sites) and exit (exit cli).
210
227
  - the code was testing with eslint to avoid errors to execute
211
228
  - rewrite the module docs.
212
- ### Changed
229
+ #### Changed
213
230
  - the list options with inquirer
214
231
  - welcome message modified
215
232
 
216
- ## version 1.0.5
217
- ### Changed
233
+ ### version 1.0.5
234
+ #### Changed
218
235
  - modify the code and module structure
219
- ### remove
236
+ #### remove
220
237
  - remove the commander module
221
238
 
222
- ## version 1.0.4
239
+ #### version 1.0.4
223
240
  - fisrt official version in npm with the modules:
224
241
  - wappalyzer
225
242
  - inquirer
226
243
  - commander
227
244
 
228
- ## version 1.0.1 to 1.0.3
245
+ #### version 1.0.1 to 1.0.3
229
246
  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,49 @@
1
+ // colors
2
+ import colors from "colors";
3
+
4
+ // utils
5
+ import { listFormat, stackSave } from "../utils.js";
6
+
7
+ /**
8
+ * @async
9
+ * @param {number | string} pokemon
10
+ * @returns {Promise<void>}
11
+ */
12
+ export default async function pokemonInfo(pokemon) {
13
+ console.clear();
14
+
15
+ try {
16
+ const data = await (
17
+ await fetch(`https://pokeapi.co/api/v2/pokemon/${pokemon}`)
18
+ ).json();
19
+
20
+ const {
21
+ id,
22
+ name,
23
+ height,
24
+ base_experience,
25
+ weight,
26
+ stats,
27
+ types
28
+ } = data;
29
+
30
+ const info = {
31
+ id,
32
+ name,
33
+ height,
34
+ base_experience,
35
+ weight,
36
+ types: listFormat.format(types.map(({ type }) => type.name))
37
+ };
38
+
39
+ stats.forEach(({ base_stat, stat }) => {
40
+ info[stat.name] = base_stat;
41
+ });
42
+
43
+ console.info(info);
44
+
45
+ stackSave("poke-info.json", JSON.stringify(info, null, 2));
46
+ } catch(err) {
47
+ console.info(colors.red(err.message));
48
+ }
49
+ }
@@ -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, 2e3);
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,33 @@
1
1
  {
2
2
  "name": "stack-analyze",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
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
11
  "axios": "^1.4.0",
18
12
  "cheerio": "^1.0.0-rc.12",
19
13
  "cli-progress": "^3.12.0",
20
14
  "colors": "^1.4.0",
21
- "console-table-printer": "^2.11.1",
15
+ "console-table-printer": "^2.11.2",
22
16
  "figlet": "^1.6.0",
23
17
  "gauge": "^5.0.1",
24
- "inquirer": "^9.2.0",
25
- "systeminformation": "^5.17.12",
18
+ "inquirer": "^9.2.7",
19
+ "systeminformation": "^5.18.6",
26
20
  "timeago.js": "^4.0.2",
27
- "wappalyzer": "^6.10.62"
21
+ "wappalyzer": "^6.10.63"
28
22
  },
29
23
  "devDependencies": {
30
- "eslint": "^8.39.0",
24
+ "eslint": "^8.44.0",
31
25
  "gh-pages": "^5.0.0",
32
26
  "jsdoc": "^4.0.2"
33
27
  },
34
28
  "scripts": {
35
29
  "start": "node cli.js",
36
- "test": "jest",
30
+ "test": "node --test test/index.test.js",
37
31
  "lint:test": "eslint . --ext .js,.cjs,.mjs",
38
32
  "lint:fix": "eslint . --ext .js,.cjs,.mjs --fix",
39
33
  "docs": "jsdoc -c jsdoc.json",
package/utils.js CHANGED
@@ -24,7 +24,7 @@ const menuInfoOpts = [
24
24
  ];
25
25
 
26
26
  const menuQueryOpts = [
27
- "anime_Search", "movie_info", "twitch_info", returnMainOpts
27
+ "anime_Search", "movie_info", "pokemon_info", "twitch_info", returnMainOpts
28
28
  ];
29
29
 
30
30
  const menuUtilityOpts = [
package/hardware.csv DELETED
File without changes