stack-analyze 1.2.6 → 1.2.7
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 +6 -0
- package/about.js +21 -21
- package/cli.js +24 -0
- package/functions/download.js +28 -0
- package/functions/pageSpeed.js +2 -4
- package/hash/wallpaperSelect.js +36 -0
- package/package.json +6 -6
- package/utils.js +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ stack-analyze all version and notable changes, fixed, remove and new additions i
|
|
|
4
4
|
|
|
5
5
|
## generation 3 (ver. 1.2.0 -)
|
|
6
6
|
|
|
7
|
+
### version 1.2.7
|
|
8
|
+
#### Added
|
|
9
|
+
- wallpaper tool download (sol, moon)
|
|
10
|
+
#### changed
|
|
11
|
+
- default case in range color 91 to 100
|
|
12
|
+
|
|
7
13
|
### version 1.2.6
|
|
8
14
|
#### Changed
|
|
9
15
|
- redesign poke info tool
|
package/about.js
CHANGED
|
@@ -13,31 +13,31 @@ const timeout = 1e3;
|
|
|
13
13
|
/**
|
|
14
14
|
* types for about tools
|
|
15
15
|
*
|
|
16
|
-
* @typedef {Object}
|
|
17
|
-
* @property {string}
|
|
18
|
-
* @property {string}
|
|
19
|
-
* @property {string}
|
|
16
|
+
* @typedef {Object} Info
|
|
17
|
+
* @property {string} Info.mainDeveloper
|
|
18
|
+
* @property {string} Info.version
|
|
19
|
+
* @property {string} Info.license
|
|
20
20
|
*
|
|
21
|
-
* @typedef {Object}
|
|
22
|
-
* @property {string}
|
|
23
|
-
* @property {string}
|
|
21
|
+
* @typedef {Object} DeveloperList
|
|
22
|
+
* @property {string} DeveloperList.name
|
|
23
|
+
* @property {string} DeveloperList.roles
|
|
24
24
|
*
|
|
25
|
-
* @typedef {Object}
|
|
26
|
-
* @property {string} youtubeChannel
|
|
27
|
-
* @property {string} recomendation
|
|
25
|
+
* @typedef {Object} Youtube
|
|
26
|
+
* @property {string} Youtube.youtubeChannel
|
|
27
|
+
* @property {string} Youtube.recomendation
|
|
28
28
|
*
|
|
29
|
-
* @typedef {Object}
|
|
30
|
-
* @property {string}
|
|
31
|
-
* @property {string} [
|
|
29
|
+
* @typedef {Object} Twitch
|
|
30
|
+
* @property {string} Twitch.user
|
|
31
|
+
* @property {string} [Twitch.details]
|
|
32
32
|
*
|
|
33
|
-
* @typedef {Object}
|
|
34
|
-
* @property {string}
|
|
35
|
-
* @property {string}
|
|
33
|
+
* @typedef {Object} Project
|
|
34
|
+
* @property {string} Project.name
|
|
35
|
+
* @property {string} Project.desc
|
|
36
36
|
*/
|
|
37
37
|
|
|
38
38
|
const aboutTool = {
|
|
39
39
|
mainInfo(refreshCallback) {
|
|
40
|
-
/** @type {
|
|
40
|
+
/** @type {Info} */
|
|
41
41
|
const aboutApp = {
|
|
42
42
|
mainDeveloper: "omega5300",
|
|
43
43
|
license,
|
|
@@ -50,7 +50,7 @@ const aboutTool = {
|
|
|
50
50
|
setTimeout(refreshCallback, timeout);
|
|
51
51
|
},
|
|
52
52
|
lineup(refreshCallback) {
|
|
53
|
-
/** @type {
|
|
53
|
+
/** @type {DeveloperList[]} */
|
|
54
54
|
const developers = [
|
|
55
55
|
{
|
|
56
56
|
name: "omega5300",
|
|
@@ -63,7 +63,7 @@ const aboutTool = {
|
|
|
63
63
|
setTimeout(refreshCallback, timeout);
|
|
64
64
|
},
|
|
65
65
|
youtubeRecomendation(refreshCallback) {
|
|
66
|
-
/** @type {
|
|
66
|
+
/** @type {Youtube[]} */
|
|
67
67
|
const youtubeDev = [
|
|
68
68
|
{ youtubeChannel: "fazt", recomendation: "recommend" },
|
|
69
69
|
{ youtubeChannel: "doriandesings", recomendation: "recommend" },
|
|
@@ -78,7 +78,7 @@ const aboutTool = {
|
|
|
78
78
|
setTimeout(refreshCallback, timeout);
|
|
79
79
|
},
|
|
80
80
|
twitchRecomendation(refreshCallback) {
|
|
81
|
-
/** @type {
|
|
81
|
+
/** @type {Twitch[]} */
|
|
82
82
|
const twitchUsers = [
|
|
83
83
|
{
|
|
84
84
|
user: "DannyAgii",
|
|
@@ -98,7 +98,7 @@ const aboutTool = {
|
|
|
98
98
|
setTimeout(refreshCallback, timeout);
|
|
99
99
|
},
|
|
100
100
|
projectsRecomendation(refreshCallback) {
|
|
101
|
-
/** @type {
|
|
101
|
+
/** @type {Project[]} */
|
|
102
102
|
const projects = [
|
|
103
103
|
{
|
|
104
104
|
name: "Doofy's Projects",
|
package/cli.js
CHANGED
|
@@ -8,6 +8,7 @@ import webTools from "./hash/webTools.js";
|
|
|
8
8
|
import queryTools from "./hash/queryTools.js";
|
|
9
9
|
import infoTools from "./hash/infoTools.js";
|
|
10
10
|
import utilityTools from "./hash/utilityTools.js";
|
|
11
|
+
import wallpaperSelect from "./hash/wallpaperSelect.js";
|
|
11
12
|
import aboutTool from "./about.js";
|
|
12
13
|
|
|
13
14
|
import {
|
|
@@ -16,6 +17,7 @@ import {
|
|
|
16
17
|
menuWebOpts,
|
|
17
18
|
menuAboutOpts,
|
|
18
19
|
menuInfoOpts,
|
|
20
|
+
menuWallpaperOpts,
|
|
19
21
|
menuUtilityOpts
|
|
20
22
|
} from "./utils.js";
|
|
21
23
|
|
|
@@ -81,6 +83,24 @@ async function queryOpts() {
|
|
|
81
83
|
: queryTools[query](returnMain);
|
|
82
84
|
}
|
|
83
85
|
|
|
86
|
+
/**
|
|
87
|
+
* @async
|
|
88
|
+
* @returns {Promise<void>}
|
|
89
|
+
*/
|
|
90
|
+
async function wallpapersOpts() {
|
|
91
|
+
const { wallpaper } = await inquirer.prompt({
|
|
92
|
+
type: "list",
|
|
93
|
+
pageSize,
|
|
94
|
+
name: "wallpaper",
|
|
95
|
+
message: "enter a wallpaper selector",
|
|
96
|
+
choices: menuWallpaperOpts
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
wallpaper === "return main menu"
|
|
100
|
+
? mainMenu()
|
|
101
|
+
: wallpaperSelect[wallpaper](returnMain, wallpapersOpts);
|
|
102
|
+
}
|
|
103
|
+
|
|
84
104
|
/**
|
|
85
105
|
* @async
|
|
86
106
|
* @returns {Promise<void>}
|
|
@@ -149,6 +169,10 @@ async function mainMenu() {
|
|
|
149
169
|
console.clear();
|
|
150
170
|
utilityOpts();
|
|
151
171
|
},
|
|
172
|
+
wallpapers() {
|
|
173
|
+
console.clear();
|
|
174
|
+
wallpapersOpts();
|
|
175
|
+
},
|
|
152
176
|
about() {
|
|
153
177
|
console.clear();
|
|
154
178
|
aboutOpts();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// save password
|
|
2
|
+
import { stackSave } from "../utils.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* sol, moon wallpapers downloader
|
|
6
|
+
* @async
|
|
7
|
+
* @param {string} filename
|
|
8
|
+
* @returns {Promise<void>}
|
|
9
|
+
*/
|
|
10
|
+
export const solMoonDownload = async (filename) => {
|
|
11
|
+
console.info(filename);
|
|
12
|
+
|
|
13
|
+
const url = `https://sol-moon-wallpapers.vercel.app/api/download/${filename}`;
|
|
14
|
+
|
|
15
|
+
try {
|
|
16
|
+
const res = await fetch(url);
|
|
17
|
+
|
|
18
|
+
if(!res.ok) {
|
|
19
|
+
throw new Error(`Error HTTP: ${res.status}`);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const data = await res.blob();
|
|
23
|
+
|
|
24
|
+
stackSave(filename, data.stream());
|
|
25
|
+
} catch(err) {
|
|
26
|
+
console.error(colors.red(err.message));
|
|
27
|
+
}
|
|
28
|
+
};
|
package/functions/pageSpeed.js
CHANGED
|
@@ -20,14 +20,12 @@ const barColor = score => {
|
|
|
20
20
|
const bar = "{bar}";
|
|
21
21
|
|
|
22
22
|
switch (true) {
|
|
23
|
-
case score ===
|
|
23
|
+
case score === 0 || score <= 49:
|
|
24
24
|
return bar.red;
|
|
25
25
|
case score === 50 || score <= 89:
|
|
26
26
|
return bar.yellow;
|
|
27
|
-
case score >= 90 || score === maxScore:
|
|
28
|
-
return bar.green;
|
|
29
27
|
default:
|
|
30
|
-
return bar.
|
|
28
|
+
return bar.green;
|
|
31
29
|
}
|
|
32
30
|
};
|
|
33
31
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// stock module
|
|
2
|
+
import { performance } from "node:perf_hooks";
|
|
3
|
+
|
|
4
|
+
// inquirer
|
|
5
|
+
import inquirer from "inquirer";
|
|
6
|
+
import colors from "colors";
|
|
7
|
+
|
|
8
|
+
import { solMoonDownload } from "../functions/download.js";
|
|
9
|
+
|
|
10
|
+
const wallpaperSelect = {
|
|
11
|
+
// refreshCallback
|
|
12
|
+
solMoon(refreshCallback, alternativeCallback) {
|
|
13
|
+
const solMoonWallpapers = [...Array(20).keys()]
|
|
14
|
+
.map(i => `sol-moon${i + 1}.jpeg`);
|
|
15
|
+
|
|
16
|
+
inquirer.prompt([
|
|
17
|
+
{
|
|
18
|
+
type: "list",
|
|
19
|
+
name: "wallpaper",
|
|
20
|
+
message: "select a wallpaper for download:",
|
|
21
|
+
choices: [...solMoonWallpapers, "back to menu"]
|
|
22
|
+
}
|
|
23
|
+
])
|
|
24
|
+
.then(({ wallpaper }) => {
|
|
25
|
+
if (wallpaper === "back to menu") {
|
|
26
|
+
alternativeCallback();
|
|
27
|
+
} else {
|
|
28
|
+
solMoonDownload(wallpaper);
|
|
29
|
+
setTimeout(refreshCallback, 5000);
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
.catch(err => console.error(colors.red(err.message)));
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default wallpaperSelect;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stack-analyze",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.7",
|
|
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",
|
|
@@ -8,21 +8,21 @@
|
|
|
8
8
|
"stack-analyze": "cli.js"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"axios": "^1.
|
|
11
|
+
"axios": "^1.6.0",
|
|
12
12
|
"boxen": "^7.1.1",
|
|
13
13
|
"cheerio": "^1.0.0-rc.12",
|
|
14
14
|
"cli-progress": "^3.12.0",
|
|
15
15
|
"colors": "^1.4.0",
|
|
16
16
|
"console-table-printer": "^2.11.2",
|
|
17
|
-
"figlet": "^1.
|
|
17
|
+
"figlet": "^1.7.0",
|
|
18
18
|
"gauge": "^5.0.1",
|
|
19
|
-
"inquirer": "^9.2.
|
|
20
|
-
"systeminformation": "^5.21.
|
|
19
|
+
"inquirer": "^9.2.11",
|
|
20
|
+
"systeminformation": "^5.21.15",
|
|
21
21
|
"timeago.js": "^4.0.2",
|
|
22
22
|
"wappalyzer": "^6.10.63"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"eslint": "^8.
|
|
25
|
+
"eslint": "^8.53.0",
|
|
26
26
|
"gh-pages": "^6.0.0",
|
|
27
27
|
"jsdoc": "^4.0.2"
|
|
28
28
|
},
|
package/utils.js
CHANGED
|
@@ -12,7 +12,7 @@ const currency = new Intl.NumberFormat("en-us", {
|
|
|
12
12
|
const returnMainOpts = "return main menu";
|
|
13
13
|
|
|
14
14
|
const menuOpts = [
|
|
15
|
-
"web", "info", "query", "utility", "about", "exit"
|
|
15
|
+
"web", "info", "query", "utility", "wallpapers", "about", "exit"
|
|
16
16
|
];
|
|
17
17
|
|
|
18
18
|
const menuWebOpts = [
|
|
@@ -31,6 +31,8 @@ const menuUtilityOpts = [
|
|
|
31
31
|
"hardware", "password", returnMainOpts
|
|
32
32
|
];
|
|
33
33
|
|
|
34
|
+
const menuWallpaperOpts = ["solMoon", returnMainOpts];
|
|
35
|
+
|
|
34
36
|
const menuHardwareOpts = [
|
|
35
37
|
"cpuInfo", "ramMemInfo", "osDetail", "diskInfo",
|
|
36
38
|
"controllerInfo", "displayInfo", "biosInfo", returnMainOpts
|
|
@@ -81,6 +83,7 @@ export {
|
|
|
81
83
|
menuQueryOpts,
|
|
82
84
|
menuUtilityOpts,
|
|
83
85
|
menuHardwareOpts,
|
|
86
|
+
menuWallpaperOpts,
|
|
84
87
|
menuAboutOpts,
|
|
85
88
|
scrapingOpts,
|
|
86
89
|
stackSave,
|