stack-analyze 1.2.7 → 1.2.9

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,7 +2,20 @@
2
2
 
3
3
  stack-analyze all version and notable changes, fixed, remove and new additions in code.
4
4
 
5
- ## generation 3 (ver. 1.2.0 -)
5
+ ## generation 3 (ver. 1.2.0 - 1.2.9)
6
+
7
+ ### version 1.2.9
8
+ #### Added
9
+ - css validate
10
+ #### changed
11
+ - changed wappalyzer module
12
+
13
+ ### version 1.2.8
14
+ #### Added
15
+ - dimensions wallpaper download
16
+ #### changed
17
+ - renove download wallpaper function
18
+ - about script using cjs
6
19
 
7
20
  ### version 1.2.7
8
21
  #### Added
@@ -1,11 +1,7 @@
1
1
  // print table
2
- import { printTable } from "console-table-printer";
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
- export default aboutTool;
117
+ module.exports = aboutTool;
@@ -0,0 +1,6 @@
1
+ import axios from "axios";
2
+
3
+ export const wallpapersURL = axios.create({
4
+ baseURL: "https://sol-moon-wallpapers.vercel.app/",
5
+ responseType: "stream"
6
+ });
package/api/webApis.js CHANGED
@@ -1,4 +1,4 @@
1
- import Wappalyzer from "wappalyzer";
1
+ import Wappalyzer from "wapalyzer";
2
2
  import axios from "axios";
3
3
 
4
4
  const wappalyzer = new Wappalyzer();
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.js";
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 {Promise<void>}
88
+ * @returns {void}
89
89
  */
90
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
- });
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
- wallpaper === "return main menu"
100
- ? mainMenu()
101
- : wallpaperSelect[wallpaper](returnMain, wallpapersOpts);
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
- console.clear();
174
- wallpapersOpts();
173
+ console.clear();
174
+ wallpapersOpts();
175
175
  },
176
176
  about() {
177
177
  console.clear();
@@ -0,0 +1,25 @@
1
+ // modules
2
+ import colors from "colors";
3
+ import cssValidator from "w3c-css-validator";
4
+ import { stackSave } from "../utils.js";
5
+
6
+ /**
7
+ * @description css validator tool from w3c service
8
+ * @param {string} url - url analyze all stylesheets
9
+ * @async
10
+ * @returns {Promise<void>}
11
+ */
12
+ export default async function cssValidate(url) {
13
+ try {
14
+ const cssResults = await cssValidator.validateURL(url, {
15
+ warningLevel: 1
16
+ });
17
+
18
+ stackSave("cssErrors.json", JSON.stringify(cssResults.errors, null, 2));
19
+ stackSave("cssWarnings.json", JSON.stringify(cssResults.warnings, null, 2));
20
+
21
+ console.info("finish css results printers".green);
22
+ } catch(err) {
23
+ console.error(colors.red(err.message));
24
+ }
25
+ }
@@ -1,28 +1,24 @@
1
- // save password
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
- * 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
- }
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
  };
@@ -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 { solMoonDownload } from "../functions/download.js";
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
- // 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
- }
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/hash/webTools.js CHANGED
@@ -9,6 +9,7 @@ import singleStack from "../functions/singleStack.js";
9
9
  import multipleStack from "../functions/multipleStack.js";
10
10
  import pageSpeed from "../functions/pageSpeed.js";
11
11
  import scrape from "../functions/scraping.js";
12
+ import cssValidate from "../functions/cssValidator.js";
12
13
 
13
14
  // validations
14
15
  import {
@@ -52,6 +53,15 @@ const webTools = {
52
53
  scrape(url, option);
53
54
  setTimeout(refreshCallback, 3000);
54
55
  });
56
+ },
57
+ css_validate(refreshCallback) {
58
+ console.clear();
59
+ inquirer.prompt([singleWebQuery])
60
+ .then(({ url }) => {
61
+ cssValidate(url);
62
+ const timeEnd = performance.now();
63
+ setTimeout(refreshCallback, timeEnd);
64
+ });
55
65
  }
56
66
  };
57
67
 
package/package.json CHANGED
@@ -1,29 +1,29 @@
1
1
  {
2
2
  "name": "stack-analyze",
3
- "version": "1.2.7",
3
+ "version": "1.2.9",
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
- "main": "index.mjs",
6
+ "main": "cli.js",
7
7
  "bin": {
8
8
  "stack-analyze": "cli.js"
9
9
  },
10
10
  "dependencies": {
11
- "axios": "^1.6.0",
11
+ "axios": "^1.6.7",
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
- "console-table-printer": "^2.11.2",
16
+ "console-table-printer": "^2.12.0",
17
17
  "figlet": "^1.7.0",
18
18
  "gauge": "^5.0.1",
19
- "inquirer": "^9.2.11",
20
- "systeminformation": "^5.21.15",
19
+ "inquirer": "^9.2.15",
20
+ "systeminformation": "^5.22.0",
21
21
  "timeago.js": "^4.0.2",
22
- "wappalyzer": "^6.10.63"
22
+ "w3c-css-validator": "^1.3.2",
23
+ "wapalyzer": "^6.10.65"
23
24
  },
24
25
  "devDependencies": {
25
- "eslint": "^8.53.0",
26
- "gh-pages": "^6.0.0",
26
+ "eslint": "^8.57.0",
27
27
  "jsdoc": "^4.0.2"
28
28
  },
29
29
  "scripts": {
@@ -31,8 +31,7 @@
31
31
  "test": "node --test test/index.test.js",
32
32
  "lint:test": "eslint . --ext .js,.cjs,.mjs",
33
33
  "lint:fix": "eslint . --ext .js,.cjs,.mjs --fix",
34
- "docs": "jsdoc -c jsdoc.json",
35
- "docs:deploy": "npm run docs && gh-pages -d docs"
34
+ "docs": "jsdoc -c jsdoc.json"
36
35
  },
37
36
  "repository": {
38
37
  "type": "git",
package/utils.js CHANGED
@@ -16,7 +16,8 @@ const menuOpts = [
16
16
  ];
17
17
 
18
18
  const menuWebOpts = [
19
- "single", "multiple", "pagespeed", "scraping", returnMainOpts
19
+ "single", "multiple", "pagespeed", "scraping", "css_validate",
20
+ returnMainOpts
20
21
  ];
21
22
 
22
23
  const menuInfoOpts = [
@@ -31,7 +32,7 @@ const menuUtilityOpts = [
31
32
  "hardware", "password", returnMainOpts
32
33
  ];
33
34
 
34
- const menuWallpaperOpts = ["solMoon", returnMainOpts];
35
+ const menuWallpaperOpts = ["solMoon", "dimensions", returnMainOpts];
35
36
 
36
37
  const menuHardwareOpts = [
37
38
  "cpuInfo", "ramMemInfo", "osDetail", "diskInfo",