stack-analyze 1.2.7 → 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 +7 -0
- package/{about.js → about.cjs} +5 -11
- package/api/wallpapersURL.js +6 -0
- package/cli.js +14 -14
- package/functions/download.js +20 -24
- package/hash/wallpaperSelect.js +47 -27
- package/package.json +2 -4
- package/utils.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,13 @@ 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
|
+
|
|
7
14
|
### version 1.2.7
|
|
8
15
|
#### Added
|
|
9
16
|
- wallpaper tool download (sol, moon)
|
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;
|
|
@@ -49,7 +45,9 @@ const aboutTool = {
|
|
|
49
45
|
|
|
50
46
|
setTimeout(refreshCallback, timeout);
|
|
51
47
|
},
|
|
52
|
-
lineup(refreshCallback) {
|
|
48
|
+
async lineup(refreshCallback) {
|
|
49
|
+
const { listFormat } = await import("./utils.js");
|
|
50
|
+
|
|
53
51
|
/** @type {DeveloperList[]} */
|
|
54
52
|
const developers = [
|
|
55
53
|
{
|
|
@@ -100,10 +98,6 @@ const aboutTool = {
|
|
|
100
98
|
projectsRecomendation(refreshCallback) {
|
|
101
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
|
@@ -9,7 +9,7 @@ import queryTools from "./hash/queryTools.js";
|
|
|
9
9
|
import infoTools from "./hash/infoTools.js";
|
|
10
10
|
import utilityTools from "./hash/utilityTools.js";
|
|
11
11
|
import wallpaperSelect from "./hash/wallpaperSelect.js";
|
|
12
|
-
import aboutTool from "./about.
|
|
12
|
+
import aboutTool from "./about.cjs";
|
|
13
13
|
|
|
14
14
|
import {
|
|
15
15
|
menuOpts,
|
|
@@ -85,20 +85,20 @@ async function queryOpts() {
|
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
87
|
* @async
|
|
88
|
-
* @returns {
|
|
88
|
+
* @returns {void}
|
|
89
89
|
*/
|
|
90
90
|
async function wallpapersOpts() {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
98
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
wallpaper === "return main menu"
|
|
100
|
+
? mainMenu()
|
|
101
|
+
: wallpaperSelect[wallpaper](returnMain, wallpapersOpts);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
/**
|
|
@@ -170,8 +170,8 @@ async function mainMenu() {
|
|
|
170
170
|
utilityOpts();
|
|
171
171
|
},
|
|
172
172
|
wallpapers() {
|
|
173
|
-
|
|
174
|
-
|
|
173
|
+
console.clear();
|
|
174
|
+
wallpapersOpts();
|
|
175
175
|
},
|
|
176
176
|
about() {
|
|
177
177
|
console.clear();
|
package/functions/download.js
CHANGED
|
@@ -1,28 +1,24 @@
|
|
|
1
|
-
//
|
|
1
|
+
// colors module
|
|
2
|
+
import colors from "colors";
|
|
3
|
+
|
|
4
|
+
// url api
|
|
5
|
+
import { wallpapersURL } from "../api/wallpapersURL.js";
|
|
6
|
+
|
|
7
|
+
// save file
|
|
2
8
|
import { stackSave } from "../utils.js";
|
|
3
9
|
|
|
4
10
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
}
|
|
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
|
+
}
|
|
28
24
|
};
|
package/hash/wallpaperSelect.js
CHANGED
|
@@ -1,36 +1,56 @@
|
|
|
1
|
-
// stock module
|
|
2
|
-
import { performance } from "node:perf_hooks";
|
|
3
|
-
|
|
4
1
|
// inquirer
|
|
5
2
|
import inquirer from "inquirer";
|
|
6
3
|
import colors from "colors";
|
|
7
4
|
|
|
8
|
-
import {
|
|
5
|
+
import { wallpaperDownload } from "../functions/download.js";
|
|
6
|
+
|
|
7
|
+
const message = "select a wallpaper for download:";
|
|
8
|
+
const backMenu = "back to menu";
|
|
9
9
|
|
|
10
10
|
const wallpaperSelect = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
+
}
|
|
34
54
|
};
|
|
35
55
|
|
|
36
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",
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"eslint": "^8.53.0",
|
|
26
|
-
"gh-pages": "^6.0.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
|
@@ -31,7 +31,7 @@ const menuUtilityOpts = [
|
|
|
31
31
|
"hardware", "password", returnMainOpts
|
|
32
32
|
];
|
|
33
33
|
|
|
34
|
-
const menuWallpaperOpts = ["solMoon", returnMainOpts];
|
|
34
|
+
const menuWallpaperOpts = ["solMoon", "dimensions", returnMainOpts];
|
|
35
35
|
|
|
36
36
|
const menuHardwareOpts = [
|
|
37
37
|
"cpuInfo", "ramMemInfo", "osDetail", "diskInfo",
|