stack-analyze 1.2.1 → 1.2.3

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,12 +2,26 @@
2
2
 
3
3
  stack-analyze all version and notable changes, fixed, remove and new additions in code.
4
4
 
5
+ ## version 1.2.3
6
+ ### Added
7
+ - bundlephobia info tool
8
+ ### Changed
9
+ - change write json to csv in hardware information
10
+
11
+ ## version 1.2.2
12
+ ### Added
13
+ - add save file function for the tools
14
+ ### Changed
15
+ - change the hash table to unique function in hardware information
16
+ ### Fixed
17
+ - fixed to unique user to multiple users with split params
18
+
5
19
  ## version 1.2.1
6
- ### fixed
20
+ ### Fixed
7
21
  - rewrite form arrow functions to named function with export default.
8
22
  - rewrite some test functions.
9
23
  - add regexp form bitly info tool
10
- ### change
24
+ ### Changed
11
25
  - renove menu now using categories.
12
26
  - add api params.
13
27
  - comeback multibar from pagespeed tool
@@ -15,10 +29,10 @@ stack-analyze all version and notable changes, fixed, remove and new additions i
15
29
  ## version 1.2.0
16
30
  ### Added
17
31
  - new tool password generator
18
- ### fixed
32
+ ### Fixed
19
33
  - update anime search tool
20
34
  - the files modules now using callbacks and remove no using vars
21
- ### change
35
+ ### Changed
22
36
  - the web scraping tool decided to use the question returns to the main menu instead of going to the main menu
23
37
 
24
38
  ## version 1.1.9
@@ -26,9 +40,9 @@ stack-analyze all version and notable changes, fixed, remove and new additions i
26
40
  - new module cheerio
27
41
  - new tool webscraping
28
42
  - new test
29
- ### fixed
43
+ ### Fixed
30
44
  - rewirte axios import
31
- ### change
45
+ ### Changed
32
46
  - hardware information change from functions to hash table
33
47
  - about now is hash table
34
48
  - now using the function printTable avoid overwritting.
@@ -38,10 +52,10 @@ stack-analyze all version and notable changes, fixed, remove and new additions i
38
52
  - remove hash tables
39
53
 
40
54
  ## version 1.1.8
41
- ### fixed
55
+ ### Fixed
42
56
  - restructure all tools as a hash table with promises except the tool hardware information and about section
43
57
  - update all modules
44
- ### change
58
+ ### Changed
45
59
  - remove the module coingecko-api
46
60
  - remove process.env variables to writting manual token for security
47
61
 
@@ -49,11 +63,11 @@ stack-analyze all version and notable changes, fixed, remove and new additions i
49
63
  ### Added
50
64
  - twitch info tool
51
65
  - remove one js module for module to cjs and esm
52
- ### fixed
66
+ ### Fixed
53
67
  - change write token to process.env varaibles own (not avalible values in github and gitlab)
54
68
  - migrate cjs to esm
55
69
  - rewrite module
56
- ### change
70
+ ### Changed
57
71
  - except some hardware tools and github using models from console-table-printer
58
72
  - now using esm now about is js file not folder about with index.js
59
73
  - rewrite all tests functions
@@ -61,9 +75,9 @@ stack-analyze all version and notable changes, fixed, remove and new additions i
61
75
  ## version 1.1.6
62
76
  ### Added
63
77
  - module stack-analyze mode
64
- ### fixed
78
+ ### Fixed
65
79
  - rewrite code
66
- ### changed
80
+ ### Changed
67
81
  - menu renove
68
82
  - renove jsdocs in some function or variables
69
83
  - remove nonolive recommends soon in versions desktop 7 and pwa 1.5.0
@@ -73,10 +87,10 @@ stack-analyze all version and notable changes, fixed, remove and new additions i
73
87
  - add new tool: movie info
74
88
  - add new test
75
89
  - renove menu
76
- ### fixed
90
+ ### Fixed
77
91
  - rewrite in some functions and about
78
92
  - remove some dependencies not using project
79
- ### changed
93
+ ### Changed
80
94
  - change multibar to 2 single bars
81
95
  - change switch in all tools for hash functions tables
82
96
  - renove nonolive recommends
@@ -85,7 +99,7 @@ stack-analyze all version and notable changes, fixed, remove and new additions i
85
99
  ### Added
86
100
  - add new tool: bitly info
87
101
  - add new test
88
- ### fixed
102
+ ### Fixed
89
103
  - rewrite some functions
90
104
  - update npm modules via manual
91
105
 
@@ -95,31 +109,31 @@ stack-analyze all version and notable changes, fixed, remove and new additions i
95
109
  - add new tool: crypto market
96
110
  - add new recomends
97
111
  - add new test
98
- ### fixed
112
+ ### Fixed
99
113
  - rewrite some functions
100
114
  - update npm modules via manual
101
- ### changed
115
+ ### Changed
102
116
  - add new const variables for map array functions
103
117
 
104
118
  ## version 1.1.2
105
119
  ### Added
106
120
  - add new nonolive streamers Recomend
107
- ### fixed
121
+ ### Fixed
108
122
  - rewrite multiple techstack
109
123
  - rewrite test files
110
- ### changed
124
+ ### Changed
111
125
  - changed the for loop to foreach loop
112
126
 
113
127
  ## version 1.1.1
114
128
  ### Added
115
129
  - using console.table only in objects variables
116
- - using the console-table-printer in arrays in some functions and the about sectiond
130
+ - using the console-table-printer in arrays in some functions and the about section
117
131
  - add the new module: console-table-printer
118
132
  - add the new nonolive streamers and youtube dev recommedation
119
- ### fixed
133
+ ### Fixed
120
134
  - rewrite some funcions
121
135
  - fragment about section
122
- ### changed
136
+ ### Changed
123
137
  - using console.table only in objects variables
124
138
  - using the console-table-printer in arrays in some functions and the about section
125
139
 
@@ -130,7 +144,7 @@ stack-analyze all version and notable changes, fixed, remove and new additions i
130
144
  - jsdoc + the template minami the dev modules
131
145
  - add the hardware information
132
146
  - add new recomendations for about section
133
- ### fixed
147
+ ### Fixed
134
148
  - rewrite the code the functions singlestack and multiple
135
149
  - add the name app to question function
136
150
  ### Changed
@@ -152,7 +166,7 @@ stack-analyze all version and notable changes, fixed, remove and new additions i
152
166
  - add the new modules:
153
167
  - colors
154
168
  - cli-progress
155
- ### fixed
169
+ ### Fixed
156
170
  change json print to table print version
157
171
  ### Changed
158
172
  - change console.dir about to console.table
package/about.js CHANGED
@@ -80,11 +80,11 @@ const aboutTool = {
80
80
  /** @type {twitch[]} */
81
81
  const twitchUsers = [
82
82
  {
83
- user: "dannyaegyo",
83
+ user: "DannyAgii",
84
84
  },
85
85
  {
86
86
  user: "Lunanny",
87
- details: "audiovisual student with ADHD."
87
+ details: "art director with ADHD."
88
88
  }
89
89
  ];
90
90
 
@@ -102,7 +102,11 @@ const aboutTool = {
102
102
  {
103
103
  name: "black metal promotion",
104
104
  desc: "promos albums and community"
105
- }
105
+ },
106
+ {
107
+ name: "black metal catalog",
108
+ desc: "promos albums and community"
109
+ },
106
110
  ];
107
111
 
108
112
  console.clear();
package/api/webApis.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import Wappalyzer from "wappalyzer";
2
- import { default as axios } from "axios";
2
+ import axios from "axios";
3
3
 
4
4
  const wappalyzer = new Wappalyzer();
5
5
 
package/cli.js CHANGED
@@ -6,7 +6,8 @@ import figlet from "figlet";
6
6
 
7
7
  import webTools from "./hash/webTools.js";
8
8
  import queryTools from "./hash/queryTools.js";
9
- import hardwareTools from "./functions/hardware.js";
9
+ import infoTools from "./hash/infoTools.js";
10
+ import utilityTools from "./hash/utilityTools.js";
10
11
  import aboutTool from "./about.js";
11
12
 
12
13
  import {
@@ -14,10 +15,11 @@ import {
14
15
  menuQueryOpts,
15
16
  menuWebOpts,
16
17
  menuAboutOpts,
17
- menuHardwareOpts
18
+ menuInfoOpts,
19
+ menuUtilityOpts
18
20
  } from "./utils.js";
19
21
 
20
- const [ gauge, totalTime, pageSize ] = [ new Gauge(), 1e4, 9 ];
22
+ const [gauge, totalTime, pageSize] = [new Gauge(), 1e4, 9];
21
23
 
22
24
  /** @returns {void} */
23
25
  const exitCli = () => {
@@ -53,30 +55,48 @@ async function infoOpts() {
53
55
  pageSize,
54
56
  name: "info",
55
57
  message: "enter a info tool option",
56
- choices: menuQueryOpts
58
+ choices: menuInfoOpts
57
59
  });
58
60
 
59
61
  info === "return main menu"
60
62
  ? mainMenu()
61
- : queryTools[info](returnMain);
63
+ : infoTools[info](returnMain);
62
64
  }
63
65
 
64
66
  /**
65
67
  * @async
66
68
  * @returns {Promise<void>}
67
69
  */
68
- async function hardwareOpts() {
69
- const { hardware } = await inquirer.prompt({
70
+ async function queryOpts() {
71
+ const { query } = await inquirer.prompt({
70
72
  type: "list",
71
- name: "hardware",
72
73
  pageSize,
73
- message: "select a hardware-information option:",
74
- choices: menuHardwareOpts
74
+ name: "query",
75
+ message: "enter a query tool option",
76
+ choices: menuQueryOpts
75
77
  });
76
78
 
77
- hardware !== "return main menu"
78
- ? hardwareTools[hardware](hardwareOpts)
79
- : mainMenu();
79
+ query === "return main menu"
80
+ ? mainMenu()
81
+ : queryTools[query](returnMain);
82
+ }
83
+
84
+ /**
85
+ * @async
86
+ * @returns {Promise<void>}
87
+ */
88
+ async function utilityOpts() {
89
+ const { utility } = await inquirer.prompt({
90
+ type: "list",
91
+ pageSize,
92
+ name: "utility",
93
+ message: "enter a utility tool option",
94
+ choices: menuUtilityOpts
95
+ });
96
+
97
+ utility === "return main menu"
98
+ ? mainMenu()
99
+ : utilityTools[utility](returnMain);
80
100
  }
81
101
 
82
102
  /**
@@ -117,13 +137,17 @@ async function mainMenu() {
117
137
  console.clear();
118
138
  webOpts();
119
139
  },
120
- query() {
140
+ info() {
121
141
  console.clear();
122
142
  infoOpts();
123
143
  },
124
- hardware() {
144
+ query() {
145
+ console.clear();
146
+ queryOpts();
147
+ },
148
+ utility() {
125
149
  console.clear();
126
- hardwareOpts();
150
+ utilityOpts();
127
151
  },
128
152
  about() {
129
153
  console.clear();
@@ -131,7 +155,7 @@ async function mainMenu() {
131
155
  }
132
156
  };
133
157
 
134
- option !== "exit" ?menuList[option]() : exitCli();
158
+ option !== "exit" ? menuList[option]() : exitCli();
135
159
  }
136
160
 
137
161
  /**
@@ -146,7 +170,7 @@ async function returnMain() {
146
170
  message: "do you want go to the main menu?",
147
171
  });
148
172
 
149
- returnMain ? mainMenu(): exitCli();
173
+ returnMain ? mainMenu() : exitCli();
150
174
  } catch (err) {
151
175
  console.error(colors.bgRed(err.message));
152
176
  }
@@ -1,9 +1,12 @@
1
1
  // modules
2
- import { default as axios } from "axios";
2
+ import axios from "axios";
3
3
  import { format } from "timeago.js";
4
4
  import colors from "colors";
5
5
  import { printTable } from "console-table-printer";
6
6
 
7
+ // save anime
8
+ import { stackSave } from "../utils.js";
9
+
7
10
  /**
8
11
  *
9
12
  * @description call the anime serach info
@@ -36,5 +39,7 @@ export default async function animeSearch(q) {
36
39
 
37
40
 
38
41
  printTable(animeData.slice(0, 10));
42
+
43
+ stackSave(`${q}-results.json`, JSON.stringify(animeData, null, 2));
39
44
  } catch (err) { console.error(colors.red(err.message)); }
40
45
  }
@@ -1,8 +1,11 @@
1
1
  // modules
2
- import { default as axios } from "axios";
2
+ import axios from "axios";
3
3
  import { format } from "timeago.js";
4
4
  import colors from "colors";
5
5
 
6
+ // save bitly
7
+ import { stackSave } from "../utils.js";
8
+
6
9
  /**
7
10
  *
8
11
  * @description call the bitly info data
@@ -30,6 +33,8 @@ export default async function bitlyInfo(link, token) {
30
33
  bitly_link: data.link,
31
34
  link: data.long_url
32
35
  });
36
+
37
+ stackSave("bitly.json", JSON.stringify(data, null, 2));
33
38
  } catch (err) {
34
39
  console.error(colors.red(err.message));
35
40
  }
@@ -0,0 +1,36 @@
1
+ import axios from "axios";
2
+ import colors from "colors";
3
+ import { stackSave } from "../utils.js";
4
+
5
+ /**
6
+ * @description kilobyte convert for bundlephobia pkg info
7
+ * @param {number} size - pkg sixe
8
+ * @returns {string} - result converter
9
+ */
10
+ const kilobyteConvert = (size) => (size < 1024 ? `${size} B` : `${size / 1024} KB`);
11
+
12
+ /**
13
+ * @description
14
+ * @param {string} pkg
15
+ * @async
16
+ * @returns { Promise<void> } - return result bundlephobia info
17
+ */
18
+ export default async function bundlephobia (pkg) {
19
+ try {
20
+ const { data } = await axios.get("https://bundlephobia.com/api/size", {
21
+ params: { package: pkg }
22
+ });
23
+
24
+ console.table({
25
+ module_name: data.name,
26
+ module_version: data.version,
27
+ module_repo: data.repository,
28
+ module_size: kilobyteConvert(data.size),
29
+ module_gzip: kilobyteConvert(data.gzip),
30
+ });
31
+
32
+ stackSave(`${pkg}-pkg-info.json`, JSON.stringify(data, null, 2));
33
+ } catch (err) {
34
+ console.error(colors.red(err.message));
35
+ }
36
+ }
@@ -1,12 +1,12 @@
1
1
  // modules
2
- import {default as axios} from "axios";
2
+ import axios from "axios";
3
3
  import { format } from "timeago.js";
4
4
  import colors from "colors";
5
5
 
6
6
  import { printTable } from "console-table-printer";
7
7
 
8
8
  // currency format
9
- import { currency } from "../utils.js";
9
+ import { currency, stackSave } from "../utils.js";
10
10
 
11
11
  /**
12
12
  * @descripiton call the crypto market list
@@ -39,6 +39,8 @@ export default async function cryptoMarket() {
39
39
 
40
40
  // print table
41
41
  printTable(coinList.slice(0, 10));
42
+
43
+ stackSave("crypto-list.json", JSON.stringify(coinList, null, 2));
42
44
  } catch (err) {
43
45
  // print err message
44
46
  console.error(colors.red(err.message));
@@ -1,8 +1,11 @@
1
1
  // modules
2
- import { default as axios } from "axios";
2
+ import axios from "axios";
3
3
  import { format } from "timeago.js";
4
4
  import colors from "colors";
5
5
 
6
+ // save git user
7
+ import { stackSave } from "../utils.js";
8
+
6
9
  /**
7
10
  *
8
11
  * @description call github info user
@@ -27,6 +30,8 @@ export default async function githubInfo(user) {
27
30
  };
28
31
 
29
32
  console.table(info);
33
+
34
+ stackSave(`${user}-info.json`, JSON.stringify(info, null, 2));
30
35
  } catch(err) {
31
36
  console.error(colors.red(err.message));
32
37
  }