stack-analyze 1.2.6 → 1.2.8
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 +13 -0
- package/{about.js → about.cjs} +26 -32
- package/api/wallpapersURL.js +6 -0
- package/cli.js +25 -1
- package/functions/download.js +24 -0
- package/functions/pageSpeed.js +2 -4
- package/hash/wallpaperSelect.js +56 -0
- package/package.json +7 -9
- package/utils.js +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,19 @@ 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.8
|
|
8
|
+
#### Added
|
|
9
|
+
- dimensions wallpaper download
|
|
10
|
+
#### changed
|
|
11
|
+
- renove download wallpaper function
|
|
12
|
+
- about script using cjs
|
|
13
|
+
|
|
14
|
+
### version 1.2.7
|
|
15
|
+
#### Added
|
|
16
|
+
- wallpaper tool download (sol, moon)
|
|
17
|
+
#### changed
|
|
18
|
+
- default case in range color 91 to 100
|
|
19
|
+
|
|
7
20
|
### version 1.2.6
|
|
8
21
|
#### Changed
|
|
9
22
|
- redesign poke info tool
|
package/{about.js → about.cjs}
RENAMED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
// print table
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { listFormat } from "./utils.js";
|
|
2
|
+
const { printTable } = require("console-table-printer");
|
|
5
3
|
|
|
6
4
|
// package.json
|
|
7
|
-
import { createRequire } from "module";
|
|
8
|
-
const require = createRequire(import.meta.url);
|
|
9
5
|
const { license, version } = require("./package.json");
|
|
10
6
|
|
|
11
7
|
const timeout = 1e3;
|
|
@@ -13,31 +9,31 @@ const timeout = 1e3;
|
|
|
13
9
|
/**
|
|
14
10
|
* types for about tools
|
|
15
11
|
*
|
|
16
|
-
* @typedef {Object}
|
|
17
|
-
* @property {string}
|
|
18
|
-
* @property {string}
|
|
19
|
-
* @property {string}
|
|
12
|
+
* @typedef {Object} Info
|
|
13
|
+
* @property {string} Info.mainDeveloper
|
|
14
|
+
* @property {string} Info.version
|
|
15
|
+
* @property {string} Info.license
|
|
20
16
|
*
|
|
21
|
-
* @typedef {Object}
|
|
22
|
-
* @property {string}
|
|
23
|
-
* @property {string}
|
|
17
|
+
* @typedef {Object} DeveloperList
|
|
18
|
+
* @property {string} DeveloperList.name
|
|
19
|
+
* @property {string} DeveloperList.roles
|
|
24
20
|
*
|
|
25
|
-
* @typedef {Object}
|
|
26
|
-
* @property {string} youtubeChannel
|
|
27
|
-
* @property {string} recomendation
|
|
21
|
+
* @typedef {Object} Youtube
|
|
22
|
+
* @property {string} Youtube.youtubeChannel
|
|
23
|
+
* @property {string} Youtube.recomendation
|
|
28
24
|
*
|
|
29
|
-
* @typedef {Object}
|
|
30
|
-
* @property {string}
|
|
31
|
-
* @property {string} [
|
|
25
|
+
* @typedef {Object} Twitch
|
|
26
|
+
* @property {string} Twitch.user
|
|
27
|
+
* @property {string} [Twitch.details]
|
|
32
28
|
*
|
|
33
|
-
* @typedef {Object}
|
|
34
|
-
* @property {string}
|
|
35
|
-
* @property {string}
|
|
29
|
+
* @typedef {Object} Project
|
|
30
|
+
* @property {string} Project.name
|
|
31
|
+
* @property {string} Project.desc
|
|
36
32
|
*/
|
|
37
33
|
|
|
38
34
|
const aboutTool = {
|
|
39
35
|
mainInfo(refreshCallback) {
|
|
40
|
-
/** @type {
|
|
36
|
+
/** @type {Info} */
|
|
41
37
|
const aboutApp = {
|
|
42
38
|
mainDeveloper: "omega5300",
|
|
43
39
|
license,
|
|
@@ -49,8 +45,10 @@ const aboutTool = {
|
|
|
49
45
|
|
|
50
46
|
setTimeout(refreshCallback, timeout);
|
|
51
47
|
},
|
|
52
|
-
lineup(refreshCallback) {
|
|
53
|
-
|
|
48
|
+
async lineup(refreshCallback) {
|
|
49
|
+
const { listFormat } = await import("./utils.js");
|
|
50
|
+
|
|
51
|
+
/** @type {DeveloperList[]} */
|
|
54
52
|
const developers = [
|
|
55
53
|
{
|
|
56
54
|
name: "omega5300",
|
|
@@ -63,7 +61,7 @@ const aboutTool = {
|
|
|
63
61
|
setTimeout(refreshCallback, timeout);
|
|
64
62
|
},
|
|
65
63
|
youtubeRecomendation(refreshCallback) {
|
|
66
|
-
/** @type {
|
|
64
|
+
/** @type {Youtube[]} */
|
|
67
65
|
const youtubeDev = [
|
|
68
66
|
{ youtubeChannel: "fazt", recomendation: "recommend" },
|
|
69
67
|
{ youtubeChannel: "doriandesings", recomendation: "recommend" },
|
|
@@ -78,7 +76,7 @@ const aboutTool = {
|
|
|
78
76
|
setTimeout(refreshCallback, timeout);
|
|
79
77
|
},
|
|
80
78
|
twitchRecomendation(refreshCallback) {
|
|
81
|
-
/** @type {
|
|
79
|
+
/** @type {Twitch[]} */
|
|
82
80
|
const twitchUsers = [
|
|
83
81
|
{
|
|
84
82
|
user: "DannyAgii",
|
|
@@ -98,12 +96,8 @@ const aboutTool = {
|
|
|
98
96
|
setTimeout(refreshCallback, timeout);
|
|
99
97
|
},
|
|
100
98
|
projectsRecomendation(refreshCallback) {
|
|
101
|
-
/** @type {
|
|
99
|
+
/** @type {Project[]} */
|
|
102
100
|
const projects = [
|
|
103
|
-
{
|
|
104
|
-
name: "Doofy's Projects",
|
|
105
|
-
desc: "tools and systems customs"
|
|
106
|
-
},
|
|
107
101
|
{
|
|
108
102
|
name: "black metal promotion",
|
|
109
103
|
desc: "promos albums and community"
|
|
@@ -120,4 +114,4 @@ const aboutTool = {
|
|
|
120
114
|
}
|
|
121
115
|
};
|
|
122
116
|
|
|
123
|
-
|
|
117
|
+
module.exports = aboutTool;
|
package/cli.js
CHANGED
|
@@ -8,7 +8,8 @@ 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
|
|
11
|
+
import wallpaperSelect from "./hash/wallpaperSelect.js";
|
|
12
|
+
import aboutTool from "./about.cjs";
|
|
12
13
|
|
|
13
14
|
import {
|
|
14
15
|
menuOpts,
|
|
@@ -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 {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,24 @@
|
|
|
1
|
+
// colors module
|
|
2
|
+
import colors from "colors";
|
|
3
|
+
|
|
4
|
+
// url api
|
|
5
|
+
import { wallpapersURL } from "../api/wallpapersURL.js";
|
|
6
|
+
|
|
7
|
+
// save file
|
|
8
|
+
import { stackSave } from "../utils.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* sol, moon wallpapers downloader
|
|
12
|
+
* @async
|
|
13
|
+
* @param {"sol-moon" | "dimensions"} opt
|
|
14
|
+
* @param {string} filename
|
|
15
|
+
* @returns {Promise<void>}
|
|
16
|
+
*/
|
|
17
|
+
export const wallpaperDownload = async (opt, filename) => {
|
|
18
|
+
try {
|
|
19
|
+
const { data } = await wallpapersURL.get(`/${opt}/download/${filename}`);
|
|
20
|
+
stackSave(filename, data);
|
|
21
|
+
} catch(err) {
|
|
22
|
+
console.error(colors.red(err.message));
|
|
23
|
+
}
|
|
24
|
+
};
|
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,56 @@
|
|
|
1
|
+
// inquirer
|
|
2
|
+
import inquirer from "inquirer";
|
|
3
|
+
import colors from "colors";
|
|
4
|
+
|
|
5
|
+
import { wallpaperDownload } from "../functions/download.js";
|
|
6
|
+
|
|
7
|
+
const message = "select a wallpaper for download:";
|
|
8
|
+
const backMenu = "back to menu";
|
|
9
|
+
|
|
10
|
+
const wallpaperSelect = {
|
|
11
|
+
solMoon(refreshCallback, alternativeCallback) {
|
|
12
|
+
const solMoonWallpapers = [...Array(20).keys()]
|
|
13
|
+
.map(i => `sol-moon${i + 1}.jpeg`);
|
|
14
|
+
|
|
15
|
+
inquirer.prompt([
|
|
16
|
+
{
|
|
17
|
+
type: "list",
|
|
18
|
+
name: "solMoon",
|
|
19
|
+
message,
|
|
20
|
+
choices: [...solMoonWallpapers, backMenu]
|
|
21
|
+
}
|
|
22
|
+
])
|
|
23
|
+
.then(({ solMoon }) => {
|
|
24
|
+
if (solMoon === backMenu) {
|
|
25
|
+
alternativeCallback();
|
|
26
|
+
} else {
|
|
27
|
+
wallpaperDownload("sol-moon", solMoon);
|
|
28
|
+
setTimeout(refreshCallback, 5000);
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
.catch(err => console.error(colors.red(err.message)));
|
|
32
|
+
},
|
|
33
|
+
dimensions(refreshCallback, alternativeCallback) {
|
|
34
|
+
const dimensionsWallpapers = [...Array(12).keys()]
|
|
35
|
+
.map(i => `dimensions-${i + 1}.jpeg`);
|
|
36
|
+
|
|
37
|
+
inquirer.prompt([
|
|
38
|
+
{
|
|
39
|
+
type: "list",
|
|
40
|
+
name: "dimensions",
|
|
41
|
+
message,
|
|
42
|
+
choices: [...dimensionsWallpapers, backMenu]
|
|
43
|
+
}
|
|
44
|
+
])
|
|
45
|
+
.then(({ dimensions }) => {
|
|
46
|
+
if(dimensions === backMenu) {
|
|
47
|
+
alternativeCallback();
|
|
48
|
+
} else {
|
|
49
|
+
wallpaperDownload("dimensions", dimensions);
|
|
50
|
+
setTimeout(refreshCallback, 5000);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
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.8",
|
|
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,22 +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.
|
|
26
|
-
"gh-pages": "^6.0.0",
|
|
25
|
+
"eslint": "^8.53.0",
|
|
27
26
|
"jsdoc": "^4.0.2"
|
|
28
27
|
},
|
|
29
28
|
"scripts": {
|
|
@@ -31,8 +30,7 @@
|
|
|
31
30
|
"test": "node --test test/index.test.js",
|
|
32
31
|
"lint:test": "eslint . --ext .js,.cjs,.mjs",
|
|
33
32
|
"lint:fix": "eslint . --ext .js,.cjs,.mjs --fix",
|
|
34
|
-
"docs": "jsdoc -c jsdoc.json"
|
|
35
|
-
"docs:deploy": "npm run docs && gh-pages -d docs"
|
|
33
|
+
"docs": "jsdoc -c jsdoc.json"
|
|
36
34
|
},
|
|
37
35
|
"repository": {
|
|
38
36
|
"type": "git",
|
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", "dimensions", 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,
|