stack-analyze 1.0.9 → 1.0.110

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/about.js ADDED
@@ -0,0 +1,24 @@
1
+ const { version } = require('./package.json')
2
+ const formatter = require('./utils/format.js')
3
+
4
+ const devs = ['omega5300']
5
+ const keyPeoples = ['dannyaegyo', 'angel amor de danny']
6
+ const dannyLinkList = [
7
+ 'instagram',
8
+ 'patreon',
9
+ 'twitch',
10
+ 'tiktok',
11
+ 'facebook',
12
+ 'twitter'
13
+ ]
14
+
15
+ const aboutApp = {
16
+ stackAnalyzeFounder: 'omega5300',
17
+ version,
18
+ dramalandia_leader: keyPeoples[0],
19
+ key_peoples: formatter.format(keyPeoples),
20
+ dannyaegyo_links: formatter.format(dannyLinkList),
21
+ developers: formatter.format(devs),
22
+ }
23
+
24
+ module.exports = aboutApp
package/changelog.md ADDED
@@ -0,0 +1,14 @@
1
+ # changelog
2
+
3
+ todos las versiones de la nueva rama de stack-analyze
4
+
5
+ ## version 1.0.110 (1.0.11)
6
+ - new feature:
7
+ - lyrics finder from stack-analyze delta
8
+ - move to new repo
9
+ ## version 1.0.10
10
+ - primera version bajo la rama de dramalandia.
11
+ - que posee algunas de la primera generación son:
12
+ - tech-stack
13
+ - anime search
14
+ - pokemon info
package/dramaqueen.js ADDED
@@ -0,0 +1,32 @@
1
+ module.exports = `
2
+ ::::::::::::::::::::::::::::::tGGGGC0;::;8GGGGC:::::::::::::
3
+ :::::::::::::::::::::::::::::10GGG080;:180GGGG;:::::::::::::
4
+ :::::::::::::::::::::::::::::G00G0000:1880GGL:::::::::::::::
5
+ ::::::::::::::::::::::::::::;00G1000Li0800L:::;;::::::::::::
6
+ :::::::::::::::::::::::::::::00;;00810000i::;:::::::::::::::
7
+ :::::::::::::::::::::::::::::f:1L00CC00C::::::::::::::::::::
8
+ ::::::::::::::::::::::::;::;1GGG088888i:::::::::::::::::::::
9
+ ::::::::::::::::::::::,:;1;:10GGG008800i::::::::::::::::::::
10
+ ::::::::::::::::::::::,::iitG800GGG00000i:::::::::::::::::::
11
+ ::::::::::::::::::::::,,,,;GLCLftGGGGGGGf:::::::::::::::::::
12
+ ::::::::::::::::::::::,,,i01::;;ifLG800GC:::::::::::::::::::
13
+ ::::::::::::::::::::..:;G001:ii:;:;1L80Gf:::::::::::::::::::
14
+ ::::::::::::::::::,.if:0000t1i:;::;L8000f:::::::::::::::::::
15
+ :::::::::::::::::;:,,;00800Gii1i1L@88000t:::::::::::::::::::
16
+ :::::::::::::::;:,,,:0000088GCG,:C8088L1i;::::::::::::::::::
17
+ ::::::::::::::;:,,,:f8888880G80;f88888t;i:::::::::::::::::::
18
+ ::::::::::::;;:,,,,:880000000888888888t:::ii::::::::::::::::
19
+ ::::::::::;L;:,,,,,f880000t::;t88088080;,,:,,:::::::::::::::
20
+ ::::::::::Ci::,,,,i888080C:,;::iG00000881;,:::::::::::::::::
21
+ ::::::::::LC;,,:t00888008i::::;iG8888808L;::::::::::::::::::
22
+ :::::::::::;tCGCf;:880008G:,;;:iG0G0000@t,.,;:::::::::::::::
23
+ ::::::::::::::::::G88000000000888000008@L:.,::::::::::::::::
24
+ ::::::::::::::::::888880000008880G08888@C;::;:::::::::::::::
25
+ ::::::::::::::::::::t8888888888880080088t;:;;:::::::::::::::
26
+ :::::::::::::::::::::C888008888888888L@Ci;:;i:::::::::::::::
27
+ :::::::::::::::::::::t88888880808888f:fCi;;ii:::::::::::::::
28
+ :::::::::::::::::::::0888808808888881::fC1ii;:::::::::::::::
29
+ :::::::::::::::::::i88888000888888888i:::;;:::::::::::::::::
30
+ :::::::::::::::::;08888888888888888888t:::::::::::::::::::::
31
+ ::::::::::::::::iGG88888888888888888888i::::::::::::::::::::
32
+ `;
@@ -1,5 +1,7 @@
1
- // modules
2
- const axios = require("axios").default;
1
+ const axios = require('axios')
2
+ const { format } = require('timeago.js')
3
+ const { red } = require('colors')
4
+ const { printTable } = require('console-table-printer')
3
5
 
4
6
  /**
5
7
  *
@@ -8,37 +10,31 @@ const axios = require("axios").default;
8
10
  * @returns { Promise<void> } - return results serach
9
11
  *
10
12
  */
11
- const animeSearch = async (query) => {
12
- /* error manager */
13
+ async function animeSearch (query) {
13
14
  try {
14
- // call api
15
- const res = await axios.get("https://api.jikan.moe/v3/search/anime", {
15
+ const { data } = await axios.get('https://api.jikan.moe/v3/search/anime', {
16
16
  params: {
17
17
  q: query,
18
18
  limit: 10
19
19
  }
20
- });
20
+ })
21
21
 
22
- const animeData = res.data.results.map((anime) => {
23
- const { title, episodes, start_date, end_date, type } = anime;
24
-
25
- // anime dates
26
- const timeStart = new Date(start_date);
27
- const timeEnd = new Date(end_date);
22
+ const animeData = data.results.map(({
23
+ title,
24
+ episodes,
25
+ start_date,
26
+ end_date,
27
+ type
28
+ }) => ({
29
+ title,
30
+ type,
31
+ episodes,
32
+ debutDate: format(start_date),
33
+ finalDate: end_date === null ? "current date" : format(end_date)
34
+ }))
28
35
 
29
- return {
30
- title,
31
- type,
32
- episodes,
33
- debut_date: `${timeStart.getFullYear()}-${timeStart.getMonth()}-${timeStart.getDate()}`,
34
- final_date: end_date === null ? "current date" : `${timeEnd.getFullYear()}-${timeEnd.getMonth()}-${timeEnd.getDate()}`
35
- };
36
- });
36
+ printTable(animeData)
37
+ } catch(err) { console.error(red(err.message)) }
38
+ }
37
39
 
38
- console.table(animeData);
39
-
40
- } catch (err) { console.error(err.message); }
41
- };
42
-
43
- // exports module
44
- module.exports = animeSearch;
40
+ module.exports = animeSearch
@@ -0,0 +1,24 @@
1
+ const fs = require('node:fs/promises')
2
+ const lyricsFinder = require('lyrics-finder')
3
+ const { red } = require('colors')
4
+
5
+ const lyricSearch = async (artist, title) => {
6
+ const $date = new Date()
7
+ const dateFormat = new Intl.DateTimeFormat('es', {
8
+ dateStyle: 'short',
9
+ timeStyle: 'short',
10
+ hour12: true,
11
+ timeZone: 'America/Mexico_City'
12
+ })
13
+
14
+ const lyrics = await lyricsFinder(artist, title) || 'Not Found!'
15
+
16
+ if(lyrics !== 'Not Found!') {
17
+ await fs.writeFile(`${artist} - ${title}.txt`, lyrics)
18
+ console.info(`descargar finaliza: ${dateFormat.format($date)}`.green)
19
+ } else {
20
+ console.error(red(lyrics))
21
+ }
22
+ }
23
+
24
+ module.exports = lyricSearch
@@ -0,0 +1,32 @@
1
+ const axios = require('axios')
2
+ const { red } = require('colors')
3
+
4
+ const formatter = require('../utils/format.js')
5
+
6
+ const pokemonInfo = async (pokemon) => {
7
+ try {
8
+ const { data } = await axios.get(`https://pokeapi.co/api/v2/pokemon/${pokemon}`)
9
+
10
+ const { id, name } = data
11
+
12
+ const moveList = data.moves.map(move => move.move.name).slice(0, 10)
13
+ const typeList = data.types.map(type => type.type.name).slice(0, 10)
14
+
15
+ console.table({
16
+ id,
17
+ name,
18
+ hp: data.stats[0].base_stat,
19
+ attack: data.stats[1].base_stat,
20
+ defense: data.stats[2].base_stat,
21
+ special_attack: data.stats[3].base_stat,
22
+ special_defense: data.stats[4].base_stat,
23
+ speed: data.stats[5].base_stat,
24
+ types: formatter.format(typeList),
25
+ moves: formatter.format(moveList)
26
+ })
27
+
28
+ moves = moveList
29
+ } catch (err) { console.error(red(err)) }
30
+ }
31
+
32
+ module.exports = pokemonInfo
@@ -0,0 +1,46 @@
1
+ const Wappalyzer = require('wappalyzer')
2
+ const { textSync } = require('figlet')
3
+ const { red, green } = require('colors')
4
+
5
+ const stackTable = require("../models/stackTables");
6
+
7
+ const formatter = require('../utils/format.js')
8
+
9
+ /**
10
+ *
11
+ * @description call single website tech stack analyze
12
+ * @param { string } url - analyze single website stack
13
+ * @returns { Promise<void> } - return async results single web
14
+ *
15
+ */
16
+ async function techStack(url) {
17
+ const wappalyzer = await new Wappalyzer()
18
+
19
+ try {
20
+ await wappalyzer.init()
21
+
22
+ const { technologies } = await wappalyzer.open(url).analyze()
23
+
24
+ const results = technologies.map(app => {
25
+ const webCategories = app.categories.map(({ name }) => name)
26
+
27
+ return {
28
+ techName: app.name,
29
+ techWebsite: app.website,
30
+ techCategories: formatter.format(webCategories)
31
+ }
32
+ })
33
+
34
+ console.info(green(textSync(url)))
35
+
36
+ stackTable.addRows(results)
37
+
38
+ stackTable.printTable()
39
+ } catch (err) {
40
+ console.error(red(err.message))
41
+ }
42
+
43
+ await wappalyzer.destroy()
44
+ }
45
+
46
+ module.exports = techStack
package/image/logo.png ADDED
Binary file
package/image/menu.png ADDED
Binary file
package/index.js CHANGED
@@ -1,49 +1,21 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // modules
4
- const { performance } = require("perf_hooks");
5
- const inquirer = require("inquirer");
6
- const { textSync } = require("figlet");
4
+ const { performance } = require('perf_hooks')
5
+ const inquirer = require('inquirer')
6
+ const { textSync } = require('figlet')
7
+ const { red, brightMagenta } = require('colors')
8
+ const { printTable } = require('console-table-printer')
7
9
 
8
- // options
9
- const aboutApp = require("./about");
10
+ // about
11
+ const aboutApp = require('./about')
10
12
 
11
- // analyze web
12
- const singleStack = require("./functions/singleStack");
13
- const multipleStack = require("./functions/multipleStack");
13
+ // options modules
14
+ const TechStack = require("./functions/techStack")
15
+ const animeSearch = require("./functions/animeInfo")
16
+ const pokemonInfo = require('./functions/pokemonInfo')
14
17
 
15
- // pagespeed web
16
- const { desktop, mobile } = require("./functions/pageSpeed");
17
-
18
- // github info
19
- const githubInfo = require("./functions/gitUser");
20
-
21
- // anime search
22
- const animeSearch = require("./functions/animeInfo");
23
-
24
- /**
25
- *
26
- * @description call the function question raw list options
27
- * @return { void }
28
- *
29
- */
30
- function question() {
31
- inquirer.prompt({
32
- type: "rawlist",
33
- name: "analyze",
34
- message: "what option do you want to analyze stack",
35
- choices: [
36
- "single",
37
- "multiple",
38
- "pagespeed",
39
- "about",
40
- "github-info",
41
- "anime search",
42
- "exit"
43
- ]
44
- })
45
- .then((anw) => anwOption(anw.analyze));
46
- }
18
+ const image = require('./dramaqueen')
47
19
 
48
20
  /**
49
21
  *
@@ -52,135 +24,114 @@ function question() {
52
24
  *
53
25
  */
54
26
  async function returnQuestion() {
55
- const anw = await inquirer.prompt([
56
- {
57
- type: "confirm",
58
- name: "return",
59
- message: "do you want go to the main menu?",
60
- }
61
- ]);
27
+ try {
28
+ const anw = await inquirer.prompt([
29
+ {
30
+ type: "confirm",
31
+ name: "return",
32
+ message: "¿Deseas regresar al menú principal?",
33
+ }
34
+ ]);
62
35
 
63
- anw.return
64
- ? question()
65
- : console.log("\x1b[44mthanks for use stack-analyze\x1b[0m");
66
- }
67
-
68
- /**
69
- *
70
- * @description function register option anwser
71
- * @param { string } result - result option anwser
72
- * @return { void }
73
- *
74
- */
75
- function anwOption(result) {
76
- // options conditional
77
- switch (result) {
78
- case "single":
79
- console.clear();
80
- inquirer.prompt({
81
- name: "url",
82
- message: "enter url for analyze the tech stack:"
83
- })
84
- .then((anw) => {
85
- if (anw.url.indexOf("http" || "https") > -1) {
86
- singleStack(anw.url);
87
- const timeEnd = performance.now();
88
- setTimeout(returnQuestion, timeEnd);
89
- } else {
90
- console.error("\x1b[31mplease insert a URL with parameter http:// or https://");
91
- question();
92
- }
93
- });
94
- break;
95
- case "multiple":
96
- console.clear();
97
- inquirer.prompt({
98
- name: "urls",
99
- message: "enter URLs for analyze the tech stacks with whitespace without quotes example 'http://example.com https://nodejs.org': \n"
100
- })
101
- .then((anw) => {
102
- if (
103
- anw.urls.match(/(http|https)/g) !== null ||
104
- anw.urls.match(/(http|https)/g) === 2
105
- ) {
106
- const websites = anw.urls.split(" ");
107
- console.clear();
108
- multipleStack(websites);
109
- const timeEnd = performance.now();
110
- setTimeout(returnQuestion, timeEnd);
111
- } else {
112
- console.error("\x1b[31mplease in each URL insert a website the parameter https:// or http://");
113
- question();
114
- }
115
- });
116
- break;
117
- case "pagespeed":
118
- console.clear();
119
- inquirer.prompt({
120
- name: "speedWeb",
121
- message: "insert URL for page speed analyze:"
122
- })
123
- .then((anw) => {
124
- if (anw.speedWeb.indexOf("http" || "https") > -1) {
125
- console.clear();
126
- textSync(anw.speedWeb, "Small");
127
- mobile(anw.speedWeb);
128
- const timeEndA = performance.now();
129
- desktop(anw.speedWeb);
130
- const timeEndB = performance.now();
131
- setTimeout(returnQuestion, (timeEndA + timeEndB));
132
- } else {
133
- console.error("\x1b[31mplease insert a URL with parameter https;// or http://");
134
- question();
135
- }
136
- });
137
- break;
138
- case "github-info":
139
- inquirer.prompt({
140
- name: "user",
141
- message: "enter a github user"
142
- })
143
- .then((anw) => {
144
- if (anw.user !== "") {
145
- console.clear();
146
- githubInfo(anw.user);
147
- setTimeout(returnQuestion, 2000);
148
- } else {
149
- console.error("\x1b[31mplease is required the");
150
- question();
151
- }
152
- });
153
- break;
154
- case "anime search":
155
- inquirer.prompt({
156
- name: "anime",
157
- message: "enter a anime, music or ova search"
158
- })
159
- .then((anw) => {
160
- if (anw.anime !== "") {
161
- console.clear();
162
- animeSearch(anw.anime);
163
- setTimeout(returnQuestion, 5000);
164
- } else {
165
- console.error("\x1b[31mplease is required the");
166
- question();
167
- }
168
- });
169
- break;
170
- case "about":
171
- // about info cli
36
+ if (anw.return) {
172
37
  console.clear();
173
- console.table(aboutApp);
174
38
  question();
175
- break;
176
- default:
177
- console.log("\x1b[44mthanks for use stack-analyze\x1b[0m");
178
- break;
39
+ } else {
40
+ console.clear();
41
+ console.info("Gracias por usar stack-analyze dramalandia".green);
42
+ }
43
+ } catch (err) {
44
+ console.error(red(err.message));
179
45
  }
180
46
  }
181
47
 
182
- // call the message title and question list
183
- console.clear();
184
- console.info("\x1b[33m", textSync("stack-analyze"));
185
- question();
48
+ /**
49
+ @description This is a hash table with the options of the tools menu.
50
+ @type {{ single(): void, multiple(): void, pagespeed(): void, github_info(): void, anime_search(): void, crypto_market(): void, bitly_info(): void, movie_info(): void, twitch_info(): void }}
51
+ */
52
+ const toolsOpts = {
53
+ tech_stack() {
54
+ console.clear();
55
+ inquirer.prompt({
56
+ name: "url",
57
+ message: "Ingrese el link para analizar que tecnologías tiene:"
58
+ }).then(({ url }) => {
59
+ if (url.indexOf("http") === 0) {
60
+ TechStack(url);
61
+ const timeEnd = performance.now();
62
+ setTimeout(returnQuestion, timeEnd);
63
+ } else {
64
+ console.error("Por favor ingrese el link con http:// o https://".red);
65
+ }
66
+ });
67
+ },
68
+ anime_search() {
69
+ console.clear();
70
+ inquirer.prompt({
71
+ name: "anime",
72
+ message: "Ingrese el anime, película u ova para buscar"
73
+ }).then(({ anime }) => {
74
+ if (anime !== "") {
75
+ console.clear();
76
+ animeSearch(anime);
77
+ setTimeout(returnQuestion, 2000);
78
+ } else {
79
+ console.error("Por favor el anime es obligatorio".red);
80
+ }
81
+ });
82
+ },
83
+ pokemon_info() {
84
+ console.clear();
85
+ inquirer.prompt({
86
+ name: "pokemon",
87
+ message: "Ingrese el nombre o ID de Pokémon para buscar"
88
+ }).then(({ pokemon }) => {
89
+ if (pokemon !== "" || pokemon !== 0) {
90
+ console.clear();
91
+ pokemonInfo(pokemon);
92
+
93
+ setTimeout(returnQuestion, 2000);
94
+ } else {
95
+ console.error("Por favor el id o el nombre de Pokémon es obligatorio".red);
96
+ }
97
+ });
98
+ },
99
+ drama_queen() {
100
+ console.clear()
101
+ console.info('danny la reina de drama')
102
+ console.info(image)
103
+ returnQuestion()
104
+ },
105
+ about() {
106
+ console.clear()
107
+ console.table(aboutApp)
108
+ returnQuestion()
109
+ }
110
+ };
111
+
112
+
113
+ function question() {
114
+ console.clear()
115
+ console.info(brightMagenta(textSync('dramalandia')))
116
+ console.info('Software de stack-analyze para la comunidad de dramalandia'.brightYellow)
117
+ inquirer.prompt({
118
+ type: 'list',
119
+ name: 'opts',
120
+ message: 'Seleccione la herramienta a usar:',
121
+ choices: [
122
+ 'tech_stack',
123
+ 'anime_search',
124
+ 'pokemon_info',
125
+ 'drama_queen',
126
+ 'about',
127
+ 'exit'
128
+ ]
129
+ }).then(({ opts }) => {
130
+ if (opts === 'exit') {
131
+ console.clear()
132
+ console.info('Gracias por usar stack-analyze dramalandia'.green)
133
+ } else { toolsOpts[opts](); }
134
+ })
135
+ }
186
136
 
137
+ question()
@@ -0,0 +1,33 @@
1
+ const { Table } = require("console-table-printer")
2
+
3
+ const animeList = new Table({
4
+ columns: [
5
+ {
6
+ name: "title",
7
+ alignment: "left",
8
+ color: "green"
9
+ },
10
+ {
11
+ name: "type",
12
+ alignment: "left",
13
+ color: "magenta"
14
+ },
15
+ {
16
+ name: "episodes",
17
+ alignment: "left",
18
+ color: "magenta"
19
+ },
20
+ {
21
+ name: "debutDate",
22
+ alignment: "left",
23
+ color: "magenta"
24
+ },
25
+ {
26
+ name: "finalDate",
27
+ alignment: "left",
28
+ color: "green"
29
+ }
30
+ ]
31
+ })
32
+
33
+ module.exports = animeList
@@ -0,0 +1,23 @@
1
+ const { Table } = require("console-table-printer")
2
+
3
+ const stackTable = new Table({
4
+ columns: [
5
+ {
6
+ name: "techName",
7
+ alignment: "left",
8
+ color: "cyan"
9
+ },
10
+ {
11
+ name: "techWebsite",
12
+ alignment: "left",
13
+ color: "green"
14
+ },
15
+ {
16
+ name: "techCategories",
17
+ alignment: "left",
18
+ color: "cyan"
19
+ }
20
+ ]
21
+ });
22
+
23
+ module.exports = stackTable
package/package.json CHANGED
@@ -1,48 +1,32 @@
1
1
  {
2
2
  "name": "stack-analyze",
3
- "version": "1.0.9",
4
- "description": "cli tech stack analyze and pagespeed with node.js using the wappalyzer module. with google pagespeed api",
3
+ "version": "1.0.110",
4
+ "description": "edicion de stack-analyze para la comunidad de dannyaegyo",
5
5
  "main": "index.js",
6
6
  "bin": {
7
- "stack-analyze": "index.js"
7
+ "stack-dramalandia": "index.js"
8
8
  },
9
+ "scripts": {
10
+ "start": "node index.js"
11
+ },
12
+ "author": "omega5300",
13
+ "license": "MIT",
9
14
  "dependencies": {
10
- "axios": "^0.20.0",
11
- "cli-progress": "^3.8.2",
15
+ "axios": "^0.27.2",
12
16
  "colors": "^1.4.0",
13
- "figlet": "^1.5.0",
14
- "inquirer": "^7.3.3",
17
+ "console-table-printer": "^2.11.0",
18
+ "figlet": "^1.5.2",
19
+ "inquirer": "^8.2.4",
20
+ "lyrics-finder": "^21.7.0",
15
21
  "timeago.js": "^4.0.2",
16
- "wappalyzer": "^6.3.12"
17
- },
18
- "devDependencies": {
19
- "eslint": "^7.12.1",
20
- "jest": "^26.6.2"
21
- },
22
- "scripts": {
23
- "start": "node index.js",
24
- "test": "jest",
25
- "lint:test": "eslint . --ext .js",
26
- "lint:fix": "eslint . --ext .js --fix"
22
+ "wappalyzer": "^6.10.26"
27
23
  },
28
24
  "repository": {
29
25
  "type": "git",
30
- "url": "git+https://github.com/intermachine-developers/stack-analyze.git"
26
+ "url": "git+https://github.com/stack-analyze/stack-analyze-dramalandia.git"
31
27
  },
32
- "keywords": [
33
- "cli",
34
- "tech stack",
35
- "intermachine",
36
- "stack-analyze",
37
- "pagespeed analyze",
38
- "ascii art",
39
- "github user info",
40
- "anime search"
41
- ],
42
- "author": "Intermachine Developers",
43
- "license": "MIT",
44
28
  "bugs": {
45
- "url": "https://github.com/intermachine-developers/stack-analyze/issues"
29
+ "url": "https://github.com/stack-analyze/stack-analyze-dramalandia/issues"
46
30
  },
47
- "homepage": "https://github.com/intermachine-developers/stack-analyze#readme"
31
+ "homepage": "https://github.com/stack-analyze/stack-analyze-dramalandia#readme"
48
32
  }
package/readme.md CHANGED
@@ -1,27 +1,25 @@
1
- # stack analyze
1
+ # stack-analyze dramalandia
2
2
 
3
- ![logo](docs/logo-module.png)
3
+ ![logo](image/logo.png)
4
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)
5
+ sotware de consola enfocado para la comunidad dramalandia del dannyaegyo es una version simplificada de la primera generacion de stack-analyze (1.0.4 a 1.0.9) siendo el primer CLI enfocado a los fanaticos de anime.
9
6
 
10
- cli tech stack analyze with **node.js** using the wappalyzer and google pagespeed api the module this node external module or install.
11
7
 
12
- use the cli program install
8
+ ## uso
13
9
 
14
- ## example module
15
- >npx stack-analyze "using external without install"<br>
16
- >npm i -g stack-analyze "global install"<br>
17
- >note: if global install fail using npx
10
+ el uso es tanto instalacion global como uso portable
18
11
 
19
- [github repo](https://github.com/intermachine-developers/stack-analyze.git)
12
+ ``` sh
13
+ # npm 8.10 inferior
14
+ npm i -g stack-analyze@dramalandia
20
15
 
21
- [gitlab repo](https://gitlab.com/Intermachine-dev/stack-analyze)
16
+ # npm 8.12 superior
17
+ npm i --location=global stack-analyze@dramalandia
22
18
 
23
- ### extras
24
- - [changelog module](/CHANGELOG.md)
25
- ## author this project Julian David Cordoba Torres as omega5300
19
+ # uso portable
20
+ npx stack-analyze@dramalandia
21
+ ```
26
22
 
27
- **Intermachine Developers LICENSE MIT**
23
+ ## ejemplo
24
+
25
+ ![](image/menu.png)
@@ -0,0 +1 @@
1
+ module.exports = new Intl.ListFormat('en', { style: 'short', type: 'conjunction' })
package/CHANGELOG.md DELETED
@@ -1,70 +0,0 @@
1
- # changelog
2
-
3
- stack-analyze all version and notable changes, fixed, remove and new additions in code.
4
-
5
- ## version 1.0.9
6
- ### Added
7
- - add the new modules:
8
- - timeago.js for the github user
9
- - add the options github info and anime search the main options
10
- - add new recomendations for the about section
11
- ### Fixed
12
- - return the peformance now for pagespeed
13
- ### Changed
14
- - add new testing
15
-
16
- ## version 1.0.8
17
- ### Added
18
- - add the new modules:
19
- - colors
20
- - cli-progress
21
- ### fixed
22
- change json print to table print version
23
- ### Changed
24
- - change console.dir about to console.table
25
- - change from text to bar for pagespeed results
26
- - add the badge tech stack project
27
- ### patch version 1.0.85
28
- notes:
29
- - fixed the cli run
30
- - remove performance.now for the defined time in pagespeed
31
- - add recomendations sections
32
-
33
- ## version 1.0.7
34
- ### Added
35
- - add the new modules:
36
- - figlet the main module
37
- - jest dev module and testing functions
38
- - add the options page speed and about the main options
39
- - add return in a option select except about and exit
40
- ### Fixed
41
- - the website in blank or website without http:// or https:// return the main options
42
- - eslint custom rules without style guide
43
- ### Changed
44
- - changed the inquirer list to inquirer rawlist
45
- - rewirte jsdoc in all project except test files
46
- - the tech stack using other console methods console.log only in exit cli
47
-
48
- ## version 1.0.6
49
- ### Added
50
- - add the new options: multiple (analyze many sites) and exit (exit cli).
51
- - the code was testing with eslint to avoid errors to execute
52
- - rewrite the module docs.
53
- ### Changed
54
- - the list options with inquirer
55
- - welcome message modified
56
-
57
- ## version 1.0.5
58
- ### Changed
59
- - modify the code and module structure
60
- ### remove
61
- - remove the commander module
62
-
63
- ## version 1.0.4
64
- - fisrt official version in npm with the modules:
65
- - wappalyzer
66
- - inquirer
67
- - commander
68
-
69
- ## version 1.0.1 to 1.0.3
70
- test version modules without wappalyzer module (only testing)
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2020 julian david cordoba torres
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/about/index.js DELETED
@@ -1,25 +0,0 @@
1
- // version module
2
- const { version } = require("../package.json");
3
-
4
- /**
5
- * about data object
6
- * @typedef { Object } aboutApp - structure info app
7
- * @property { string } aboutApp.mainDeveloper - leader cli app developers
8
- * @property { string[] } aboutApp.developers - developers author the cli app
9
- * @property { string[] } aboutApp.devRecommendationYoutube - youtubers recomendation from omega5300
10
- * @property { string[] } aboutApp.nonoliveStreamersRecommendation - nonolive streamers recomendation from omega5300
11
- * @property { string[] } aboutApp.projectsRecommendation - projects recomendation from omega5300
12
- * @property { string[] } aboutApp.twitchRecommendation - twitch users recomendation from omega5300
13
- * @property { string } aboutApp.version - version the cli app
14
- */
15
- const aboutApp = {
16
- mainDeveloper: "omega5300",
17
- developers: ["omega5300"].join(", "),
18
- devRecommendationYoutube: ["fazt", "doriandesings", "bluuweb", "leonidas esteban"].join(", "),
19
- nonoliveStreamersRecommendation: ["⚔️GothspiceChann💰"].join(", "),
20
- projectsRecommendation: ["Doofy's Projects"].join(", "),
21
- twitchRecommendation: ["lunnany", "dannyaegyo"].join(", "),
22
- version
23
- };
24
-
25
- module.exports = aboutApp;
Binary file
@@ -1,44 +0,0 @@
1
- // modules
2
- const axios = require("axios").default;
3
- const { format } = require("timeago.js");
4
-
5
- /**
6
- *
7
- * @description call github info user
8
- * @param { string } user - get github user info
9
- * @returns { Promise<void> } - return results info
10
- *
11
- */
12
- async function githubInfo(user) {
13
- try {
14
- const res = await axios.get(`https://api.github.com/users/${user}`, {
15
- headers: {
16
- Authorization: "token a3d5c587fde84c07064688a6cce6152ba3ada184"
17
- }
18
- });
19
-
20
- if (res.status !== 404){
21
- const info = {
22
- username: res.data.login,
23
- fullName: res.data.name === null ? "no info": res.data.name,
24
- Email: res.data.email === null ? "no info": res.data.email,
25
- userFollowers: res.data.followers,
26
- userFollowing: res.data.following,
27
- accountAge: format(res.data.created_at),
28
- updated_info: format(res.data.updated_at),
29
- twitter: res.data.twitter_username === null ? "no info": res.data.twitter_username,
30
- repos: res.data.public_repos,
31
- gists: res.data.public_gists
32
- };
33
-
34
- console.table(info);
35
- } else {
36
- console.info(res.status);
37
- }
38
- } catch(err) {
39
- console.error(err);
40
- }
41
- }
42
-
43
- module.exports = githubInfo;
44
-
@@ -1,43 +0,0 @@
1
- const { textSync } = require("figlet");
2
- const Wappalyzer = require("wappalyzer");
3
-
4
- /**
5
- *
6
- * @description call multiple websites tech stack analyze
7
- * @param { string[] } urls - tech analyze in multiples websites
8
- * @returns { Promise<void> } - async results in multiples websites
9
- *
10
- */
11
- const multipleStack = async (urls) => {
12
- const wappalyzer = await new Wappalyzer();
13
-
14
- try {
15
- await wappalyzer.init();
16
-
17
- const results = await Promise.all(
18
- urls.map(async (url) => ({
19
- url,
20
- stack: await wappalyzer.open(url).analyze()
21
- })));
22
-
23
- console.info("multiple websites tech stack \n");
24
- console.group();
25
- // loop web site tech stack
26
- for (const result of results) {
27
- console.info("\x1b[36m", textSync(result.url, "Small"), "\x1b[0m");
28
- console.group();
29
- console.table(result.stack.technologies.map((app) => ({
30
- "tech-name": app.name,
31
- "tech-website": app.website,
32
- "tech-categories": Object.values(app.categories).map((categorie) => categorie.name).join(", ")
33
- })));
34
- console.groupEnd();
35
- }
36
- } catch (err) {
37
- console.error("\x1b[31m", err.message, "\x1b[0m");
38
- }
39
-
40
- await wappalyzer.destroy();
41
- };
42
-
43
- module.exports = multipleStack;
@@ -1,140 +0,0 @@
1
- // modules
2
- const axios = require("axios").default;
3
- const colors = require("colors");
4
- const cliProgress = require("cli-progress");
5
-
6
- // result pagespeed bar color
7
- let bar;
8
-
9
- /**
10
- * @description async function mobile website pagespeed
11
- * @param { string } url - website from pagespeed mobile results
12
- * @returns { Promise<void> } - return async mobile results
13
- */
14
- const mobile = async (url) => {
15
- const res = await axios.get("https://www.googleapis.com/pagespeedonline/v5/runPagespeed", {
16
- params: {
17
- url,
18
- key: "AIzaSyBEDaW4FxSZ2s1vz5CdD5Ai6PGZGdAzij0",
19
- strategy: "mobile"
20
- }
21
- });
22
-
23
- try {
24
- const movil = res.data.lighthouseResult.categories.performance.score * 100;
25
-
26
- switch (true) {
27
- case (movil === 1 || movil <= 49):
28
- bar = new cliProgress.SingleBar({
29
- format: `Mobile Result | ${colors.red("{bar}")} || {value}/{total} || bad`,
30
- barCompleteChar: "\u2588",
31
- barIncompleteChar: "\u2591",
32
- hideCursor: true
33
- });
34
- break;
35
- case (movil === 50 || movil <= 89):
36
- bar = new cliProgress.SingleBar({
37
- format: `Mobile Result | ${colors.yellow("{bar}")} || {value}/{total} decent`,
38
- barCompleteChar: "\u2588",
39
- barIncompleteChar: "\u2591",
40
- hideCursor: true
41
- });
42
- break;
43
- case (movil >= 90 || movil === 100):
44
- bar = new cliProgress.SingleBar({
45
- format: `Mobile Result | ${colors.green("{bar}")} || {value}/{total} excelent`,
46
- barCompleteChar: "\u2588",
47
- barIncompleteChar: "\u2591",
48
- hideCursor: true
49
- });
50
- break;
51
- default:
52
- bar = new cliProgress.SingleBar({
53
- format: `Mobile Result | ${colors.green("{bar}")} || {value}/{total} excelent`,
54
- barCompleteChar: "\u2588",
55
- barIncompleteChar: "\u2591",
56
- hideCursor: true
57
- });
58
- break;
59
- }
60
- // initial bar
61
- bar.start(100, 0);
62
-
63
- // update values
64
- bar.update(Math.round(movil));
65
-
66
- bar.stop();
67
- } catch (err) {
68
- console.error(err.message);
69
- }
70
- };
71
-
72
- /**
73
- *
74
- * @description async function desktop website pagespeed
75
- * @param { string } url - website from pagespeed desktop
76
- * @return { Promise<void> } - return async desktop results
77
- *
78
- */
79
- const desktop = async (url) => {
80
- const res = await axios.get("https://www.googleapis.com/pagespeedonline/v5/runPagespeed", {
81
- params: {
82
- url,
83
- key: "AIzaSyBEDaW4FxSZ2s1vz5CdD5Ai6PGZGdAzij0",
84
- strategy: "desktop"
85
- }
86
- });
87
-
88
- try {
89
- const desktop = res.data.lighthouseResult.categories.performance.score * 100;
90
-
91
- switch (true) {
92
- case (desktop === 0 || desktop <=49):
93
- bar = new cliProgress.SingleBar({
94
- format: `Desktop Result | ${colors.red("{bar}")} || {value}/{total} || bad`,
95
- barCompleteChar: "\u2588",
96
- barIncompleteChar: "\u2591",
97
- hideCursor: true
98
- });
99
- break;
100
- case (desktop === 50 || desktop <=89):
101
- bar = new cliProgress.SingleBar({
102
- format: `Desktop Result | ${colors.yellow("{bar}")} || {value}/{total} decent`,
103
- barCompleteChar: "\u2588",
104
- barIncompleteChar: "\u2591",
105
- hideCursor: true
106
- });
107
- break;
108
- case (desktop >=90 || desktop === 100):
109
- bar = new cliProgress.SingleBar({
110
- format: `Desktop Result | ${colors.green("{bar}")} || {value}/{total} excelent`,
111
- barCompleteChar: "\u2588",
112
- barIncompleteChar: "\u2591",
113
- hideCursor: true
114
- });
115
- break;
116
- default:
117
- bar = new cliProgress.SingleBar({
118
- format: `Desktop Result | ${colors.magenta("{bar}")} || {value}/{total} undifined`,
119
- barCompleteChar: "\u2588",
120
- barIncomopleteChar: "\u2591",
121
- hideCursor: true
122
- });
123
- break;
124
- }
125
- // initial bar
126
- bar.start(100, 0);
127
-
128
- // update values
129
- bar.update(Math.round(desktop));
130
-
131
- bar.stop();
132
- } catch (err) {
133
- console.error("\x1b[31m", err.message, "\x1b[0m");
134
- }
135
- };
136
-
137
- module.exports = {
138
- mobile,
139
- desktop
140
- };
@@ -1,34 +0,0 @@
1
- // module
2
- const Wappalyzer = require("wappalyzer");
3
- const { textSync } = require("figlet");
4
-
5
- /**
6
- *
7
- * @description call single website tech stack analyze
8
- * @param { string } url - analyze single website stack
9
- * @returns { Promise<void> } - return async results single web
10
- *
11
- */
12
- async function singleStack (url) {
13
- const wappalyzer = await new Wappalyzer;
14
-
15
- try {
16
- await wappalyzer.init();
17
-
18
- const results = await wappalyzer.open(url).analyze();
19
-
20
- console.info("\x1b[32m", textSync(url), "\x1b[0m");
21
-
22
- console.table(results.technologies.map((app) => ({
23
- "tech-name": app.name,
24
- "tech-website": app.website,
25
- "tech-categories": Object.values(app.categories).map((categorie) => categorie.name).join(", ")
26
- })));
27
- } catch (err) {
28
- console.error("\x1b[31m", err.message, "\x1b[0m");
29
- }
30
-
31
- await wappalyzer.destroy();
32
- }
33
-
34
- module.exports = singleStack;