stack-analyze 1.3.4 → 1.3.6

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.
@@ -1,76 +1,89 @@
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
- seyyahi2(refreshCallback, alternativeCallback) {
55
- const seyyahiWallpapers = [...Array(14).keys()]
56
- .map(i => `seyyahi2-wallpaper${i + 1}.jpg`);
57
-
58
- inquirer.prompt([
59
- {
60
- type: "list",
61
- name: "seyyahi2",
62
- message,
63
- choices: [...seyyahiWallpapers, backMenu]
64
- }
65
- ])
66
- .then(({ seyyahi2 }) => {
67
- if(seyyahi2 === backMenu) {
68
- alternativeCallback();
69
- } else {
70
- wallpaperDownload("seyyahi2", seyyahi2);
71
- }
72
- });
73
- }
74
- };
75
-
76
- export default wallpaperSelect;
1
+ // inquirer
2
+ import { select } from "@inquirer/prompts";
3
+
4
+ import { wallpaperDownload } from "../functions/download.js";
5
+
6
+ const message = "select a wallpaper for download:";
7
+ const backMenu = "back to menu";
8
+
9
+ const wallpaperSelect = {
10
+ async solMoon(refreshCallback, alternativeCallback) {
11
+ const solMoonWallpapers = [...Array(20).keys()]
12
+ .map(i => `sol-moon${i + 1}.jpeg`);
13
+
14
+
15
+ const solMoon = await select({
16
+ message, choices: [...solMoonWallpapers, backMenu]
17
+ });
18
+
19
+ if (solMoon === backMenu) {
20
+ alternativeCallback();
21
+ } else {
22
+ wallpaperDownload("sol-moon", solMoon);
23
+ setTimeout(refreshCallback, 5000);
24
+ }
25
+ },
26
+ async dimensions(refreshCallback, alternativeCallback) {
27
+ const dimensionsWallpapers = [...Array(12).keys()]
28
+ .map(i => `dimensions-${i + 1}.jpeg`);
29
+
30
+
31
+ const dimensions = await select({
32
+ message, choices: [...dimensionsWallpapers, backMenu]
33
+ });
34
+
35
+ if(dimensions === backMenu) {
36
+ alternativeCallback();
37
+ } else {
38
+ wallpaperDownload("dimensions", dimensions);
39
+ setTimeout(refreshCallback, 5000);
40
+ }
41
+ },
42
+ async seyyahi2(refreshCallback, alternativeCallback) {
43
+ const seyyahiWallpapers = [...Array(14).keys()]
44
+ .map(i => `seyyahi2-wallpaper${i + 1}.jpg`);
45
+
46
+ const seyyahi2 = await select({
47
+ message, choices: [...seyyahiWallpapers, backMenu]
48
+ });
49
+
50
+ if(seyyahi2 === backMenu) {
51
+ alternativeCallback();
52
+ } else {
53
+ wallpaperDownload("seyyahi2", seyyahi2);
54
+ setTimeout(refreshCallback, 5000);
55
+ }
56
+ },
57
+ async ancientMistery(refreshCallback, alternativeCallback) {
58
+ const ancientMisteryWallpapers = [...Array(6).keys()]
59
+ .map(i => `ancient-mistery${i + 1}.jpeg`);
60
+
61
+ const ancientMistery = await select({
62
+ message, choices: [...ancientMisteryWallpapers, backMenu]
63
+ });
64
+
65
+ if(ancientMistery === backMenu) {
66
+ alternativeCallback();
67
+ } else {
68
+ wallpaperDownload("ancient-mistery", ancientMistery);
69
+ setTimeout(refreshCallback, 5000);
70
+ }
71
+ },
72
+ async tsukyNoEmily(refreshCallback, alternativeCallback) {
73
+ const tsukyNoEmilyWallpapers = [...Array(6).keys()]
74
+ .map(i => `tsuky-no-emily${i + 1}.jpeg`);
75
+
76
+ const tsukyNoEmily = await select({
77
+ message, choices: [...tsukyNoEmilyWallpapers, backMenu]
78
+ });
79
+
80
+ if(tsukyNoEmily === backMenu) {
81
+ alternativeCallback();
82
+ } else {
83
+ wallpaperDownload("tsuky-no-emily", tsukyNoEmily);
84
+ setTimeout(refreshCallback, 5000);
85
+ }
86
+ },
87
+ };
88
+
89
+ export default wallpaperSelect;
package/hash/webTools.js CHANGED
@@ -1,68 +1,92 @@
1
- // stock module
2
- import { performance } from "node:perf_hooks";
3
-
4
- // inquirer
5
- import inquirer from "inquirer";
6
-
7
- // functions
8
- import singleStack from "../functions/singleStack.js";
9
- import multipleStack from "../functions/multipleStack.js";
10
- import pageSpeed from "../functions/pageSpeed.js";
11
- import scrape from "../functions/scraping.js";
12
- import cssValidate from "../functions/cssValidator.js";
13
-
14
- // validations
15
- import {
16
- multipleWebQuery,
17
- singleWebQuery,
18
- webScrapingQuery
19
- } from "../validations/webValidations.js";
20
-
21
- const webTools = {
22
- single(refreshCallback) {
23
- console.clear();
24
- inquirer.prompt([singleWebQuery])
25
- .then(({ url }) => {
26
- singleStack(url);
27
- const timeEnd = performance.now();
28
- setTimeout(refreshCallback, timeEnd);
29
- });
30
- },
31
- multiple(refreshCallback) {
32
- console.clear();
33
- inquirer.prompt([multipleWebQuery])
34
- .then(({webList}) => {
35
- multipleStack(webList.split(" "));
36
- const timeEnd = performance.now();
37
- setTimeout(refreshCallback, timeEnd);
38
- });
39
- },
40
- pagespeed(refreshCallback) {
41
- console.clear();
42
- inquirer.prompt([singleWebQuery])
43
- .then(({ url }) => {
44
- pageSpeed(url);
45
- const timeEnd = performance.now();
46
- setTimeout(refreshCallback, timeEnd);
47
- });
48
- },
49
- scraping(refreshCallback) {
50
- console.clear();
51
- inquirer.prompt([singleWebQuery, webScrapingQuery])
52
- .then(({ url, option }) => {
53
- scrape(url, option);
54
- setTimeout(refreshCallback, 3000);
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
- });
65
- }
66
- };
67
-
68
- export default webTools;
1
+ // stock module
2
+ import { performance } from "node:perf_hooks";
3
+
4
+ // inquirer
5
+ import { input } from "@inquirer/prompts";
6
+
7
+ // functions
8
+ import singleStack from "../functions/singleStack.js";
9
+ import multipleStack from "../functions/multipleStack.js";
10
+ import pageSpeed from "../functions/pageSpeed.js";
11
+ import scrape from "../functions/scraping.js";
12
+ import cssValidate from "../functions/cssValidator.js";
13
+
14
+ import { stackMenu } from "../menu.js";
15
+ import { scrapingOpts } from "../utils.js";
16
+
17
+ // regex
18
+ const webRegex = /https?:\/\//g;
19
+
20
+ const webTools = {
21
+ async single(refreshCallback) {
22
+ console.clear();
23
+
24
+ const url = await input({
25
+ message: "enter a url:",
26
+ validate: input => webRegex.test(input) || "enter a url valid".yellow
27
+ });
28
+
29
+ singleStack(url);
30
+ const timeEnd = performance.now();
31
+ setTimeout(refreshCallback, timeEnd);
32
+ },
33
+ async multiple(refreshCallback) {
34
+ console.clear();
35
+
36
+ const webList = await input({
37
+ message: "enter URLs for analyze the tech stacks with whitespace without quotes example 'http://example.com https://nodejs.org': \n",
38
+ validate(input) {
39
+ const pass = input.match(webRegex);
40
+
41
+ return pass && pass.length === 2 || "must be 2 sites";
42
+ }
43
+ });
44
+
45
+ multipleStack(webList.split(" "));
46
+ const timeEnd = performance.now();
47
+ setTimeout(refreshCallback, timeEnd);
48
+ },
49
+ async pagespeed(refreshCallback) {
50
+ console.clear();
51
+
52
+ const url = await input({
53
+ message: "enter a url:",
54
+ validate: input => webRegex.test(input) || "enter a url valid".yellow
55
+ });
56
+
57
+ pageSpeed(url);
58
+ const timeEnd = performance.now();
59
+ setTimeout(refreshCallback, timeEnd);
60
+ },
61
+ async scraping(refreshCallback) {
62
+ console.clear();
63
+
64
+ const { url, option } = {
65
+ option: await stackMenu({
66
+ pageSize: 9,
67
+ message: "select a web scraping option:",
68
+ choices: scrapingOpts
69
+ }),
70
+ url: await input({
71
+ message: "enter a url:",
72
+ validate: input => webRegex.test(input) || "enter a url valid".yellow
73
+ })
74
+ };
75
+
76
+ scrape(url, option);
77
+ setTimeout(refreshCallback, 3000);
78
+ },
79
+ async css_validate(refreshCallback) {
80
+ console.clear();
81
+ const url = await input({
82
+ message: "enter a url:",
83
+ validate: input => webRegex.test(input) || "enter a url valid".yellow
84
+ });
85
+
86
+ cssValidate(url);
87
+ const timeEnd = performance.now();
88
+ setTimeout(refreshCallback, timeEnd);
89
+ }
90
+ };
91
+
92
+ export default webTools;
package/logo-module.webp CHANGED
File without changes
package/menu.js ADDED
@@ -0,0 +1,13 @@
1
+ import { select } from "@inquirer/prompts";
2
+
3
+ /**
4
+ * @typedef {Object} Menu
5
+ * @property {string} message
6
+ * @property {string[]} choices
7
+ * @property {number} [pageSize]
8
+ * @param {Menu}
9
+ * @returns {Promise<any>}
10
+ */
11
+ export const stackMenu = async ({message, choices, pageSize}) => await select({
12
+ message, choices, pageSize
13
+ });
package/package.json CHANGED
@@ -1,66 +1,67 @@
1
- {
2
- "name": "stack-analyze",
3
- "version": "1.3.4",
4
- "type": "module",
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": "cli.js",
7
- "bin": {
8
- "stack-analyze": "cli.js"
9
- },
10
- "dependencies": {
11
- "axios": "^1.7.7",
12
- "boxen": "^8.0.1",
13
- "cheerio": "^1.0.0",
14
- "cli-progress": "^3.12.0",
15
- "colors": "^1.4.0",
16
- "console-table-printer": "^2.12.1",
17
- "figlet": "^1.8.0",
18
- "gauge": "^5.0.2",
19
- "inquirer": "^12.0.1",
20
- "systeminformation": "^5.23.5",
21
- "timeago.js": "^4.0.2",
22
- "w3c-css-validator": "^1.3.2",
23
- "wapalyzer": "^6.10.65"
24
- },
25
- "devDependencies": {
26
- "@eslint/js": "^9.14.0",
27
- "eslint": "^9.14.0",
28
- "globals": "^15.12.0",
29
- "jsdoc": "^4.0.4"
30
- },
31
- "scripts": {
32
- "start": "node cli.js",
33
- "test": "node --test test/index.test.js",
34
- "lint:test": "eslint -c eslint.config.js",
35
- "lint:fix": "eslint -c eslint.config.js",
36
- "docs": "jsdoc -c jsdoc.json"
37
- },
38
- "repository": {
39
- "type": "git",
40
- "url": "git+https://github.com/stack-analyze/stack-analyze.git"
41
- },
42
- "keywords": [
43
- "cli",
44
- "tech stack",
45
- "intermachine",
46
- "stack-analyze",
47
- "stack analyzer",
48
- "pagespeed analyze",
49
- "ascii art",
50
- "github user info",
51
- "anime search",
52
- "hardware information",
53
- "crypto market info",
54
- "movie info"
55
- ],
56
- "author": "stack-analyze",
57
- "license": "MIT",
58
- "bugs": {
59
- "url": "https://github.com/stack-analyze/stack-analyze/issues"
60
- },
61
- "homepage": "https://stack-analyze.github.io/stack-analyze/",
62
- "directories": {
63
- "doc": "docs",
64
- "test": "test"
65
- }
66
- }
1
+ {
2
+ "name": "stack-analyze",
3
+ "version": "1.3.6",
4
+ "type": "module",
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": "cli.js",
7
+ "bin": {
8
+ "stack-analyze": "cli.js"
9
+ },
10
+ "dependencies": {
11
+ "@inquirer/prompts": "^7.3.2",
12
+ "axios": "^1.7.7",
13
+ "boxen": "^8.0.1",
14
+ "cheerio": "^1.0.0",
15
+ "cli-progress": "^3.12.0",
16
+ "colors": "^1.4.0",
17
+ "console-table-printer": "^2.12.1",
18
+ "figlet": "^1.8.0",
19
+ "gauge": "^5.0.2",
20
+ "inquirer": "^12.0.1",
21
+ "systeminformation": "^5.23.5",
22
+ "timeago.js": "^4.0.2",
23
+ "w3c-css-validator": "^1.3.2",
24
+ "wapalyzer": "^6.10.65"
25
+ },
26
+ "devDependencies": {
27
+ "@eslint/js": "^9.14.0",
28
+ "eslint": "^9.14.0",
29
+ "globals": "^15.12.0",
30
+ "jsdoc": "^4.0.4"
31
+ },
32
+ "scripts": {
33
+ "start": "node cli.js",
34
+ "test": "node --test test/index.test.js",
35
+ "lint:test": "eslint -c eslint.config.js",
36
+ "lint:fix": "eslint -c eslint.config.js",
37
+ "docs": "jsdoc -c jsdoc.json"
38
+ },
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "git+https://github.com/stack-analyze/stack-analyze.git"
42
+ },
43
+ "keywords": [
44
+ "cli",
45
+ "tech stack",
46
+ "intermachine",
47
+ "stack-analyze",
48
+ "stack analyzer",
49
+ "pagespeed analyze",
50
+ "ascii art",
51
+ "github user info",
52
+ "anime search",
53
+ "hardware information",
54
+ "crypto market info",
55
+ "movie info"
56
+ ],
57
+ "author": "stack-analyze",
58
+ "license": "MIT",
59
+ "bugs": {
60
+ "url": "https://github.com/stack-analyze/stack-analyze/issues"
61
+ },
62
+ "homepage": "https://stack-analyze.github.io/stack-analyze/",
63
+ "directories": {
64
+ "doc": "docs",
65
+ "test": "test"
66
+ }
67
+ }
@@ -0,0 +1,31 @@
1
+ import { input} from "@inquirer/prompts";
2
+
3
+ import { scrapingOpts } from "../utils.js";
4
+
5
+ import { stackMenu } from "../menu.js";
6
+
7
+ // regex
8
+ const webRegex = /https?:\/\//g;
9
+
10
+ // inputs
11
+ const url = await input({
12
+ message: "enter a url:",
13
+ validate: input => webRegex.test(input) || "enter a url valid".yellow
14
+ });
15
+
16
+ const webList = await input({
17
+ message: "enter URLs for analyze the tech stacks with whitespace without quotes example 'http://example.com https://nodejs.org': \n",
18
+ validate(input) {
19
+ const pass = input.match(webRegex);
20
+
21
+ return pass && pass.length === 2 || "must be 2 sites";
22
+ }
23
+ });
24
+
25
+ const webScrapingQuery = await stackMenu({
26
+ pageSize: 9,
27
+ message: "select a web scraping option:",
28
+ choices: scrapingOpts
29
+ });
30
+
31
+ export { url, webList, webScrapingQuery };
package/readme.md CHANGED
@@ -1,44 +1,44 @@
1
- # stack analyze
2
-
3
- ![logo](logo-module.webp)
4
-
5
- ***
6
- [![StackShare](https://img.shields.io/badge/tech-stack-0690fa.svg?style=flat)](https://stackshare.io/intermachine-developers/stack-analyze-cli)
7
- [![npm version](https://badge.fury.io/js/stack-analyze.svg)](https://badge.fury.io/js/stack-analyze)
8
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
-
10
- <a href="https://www.buymeacoffee.com/omega5300" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>
11
-
12
-
13
- cli tech stack analyze with **node.js** using the wappalyzer and google pagespeed api the module this node external module or install.
14
-
15
- ## use the cli program install
16
-
17
- ## cli module
18
- ``` sh
19
- # npm mode a
20
- npm i -g stack-analyze
21
-
22
- # npm mode b
23
- npm i --location=global stack-analyze
24
-
25
- # if using global install
26
- stack-analyze
27
-
28
- # portable
29
- npx stack-analyze
30
- ```
31
-
32
- >note: if global install fail using npx
33
-
34
- [github repo](https://github.com/stack-analyze/stack-analyze.git)
35
-
36
- [docs](https://stack-analyze.github.io/stack-analyze/)
37
-
38
- [gitlab repo](https://gitlab.com/Intermachine-dev/stack-analyze)
39
-
40
- ### extras
41
- - [changelog module](/CHANGELOG.md)
42
- ## author this project Julian David Cordoba Torres as omega5300
43
-
44
- **stack-analyze LICENSE MIT**
1
+ # stack analyze
2
+
3
+ ![logo](logo-module.webp)
4
+
5
+ ***
6
+ [![StackShare](https://img.shields.io/badge/tech-stack-0690fa.svg?style=flat)](https://stackshare.io/intermachine-developers/stack-analyze-cli)
7
+ [![npm version](https://badge.fury.io/js/stack-analyze.svg)](https://badge.fury.io/js/stack-analyze)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
+
10
+ <a href="https://www.buymeacoffee.com/omega5300" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>
11
+
12
+
13
+ cli tech stack analyze with **node.js** using the wappalyzer and google pagespeed api the module this node external module or install.
14
+
15
+ ## use the cli program install
16
+
17
+ ## cli module
18
+ ``` sh
19
+ # npm mode a
20
+ npm i -g stack-analyze
21
+
22
+ # npm mode b
23
+ npm i --location=global stack-analyze
24
+
25
+ # if using global install
26
+ stack-analyze
27
+
28
+ # portable
29
+ npx stack-analyze
30
+ ```
31
+
32
+ >note: if global install fail using npx
33
+
34
+ [github repo](https://github.com/stack-analyze/stack-analyze.git)
35
+
36
+ [docs](https://stack-analyze.github.io/stack-analyze/)
37
+
38
+ [gitlab repo](https://gitlab.com/Intermachine-dev/stack-analyze)
39
+
40
+ ### extras
41
+ - [changelog module](/CHANGELOG.md)
42
+ ## author this project Julian David Cordoba Torres as omega5300
43
+
44
+ **stack-analyze LICENSE MIT**