stack-analyze 1.4.0 → 1.4.1

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
@@ -6,6 +6,12 @@ stack-analyze all version and notable changes, fixed, remove and new additions i
6
6
  - version 1.4.0
7
7
  - Added:
8
8
  - new tool magic ball
9
+ - version 1.4.1
10
+ - Added:
11
+ - stations info
12
+ - Changed:
13
+ - change from basic console.log for magic ball now using boxen
14
+ - update sets for tcgp info tool
9
15
 
10
16
  ## generation 4 (ver. 1.3.0 - 1.3.9)
11
17
 
@@ -0,0 +1,25 @@
1
+ import axios from "axios";
2
+ import { printTable } from "console-table-printer";
3
+ import colors from "colors";
4
+
5
+ /**
6
+ *
7
+ * @param {string} country
8
+ */
9
+ const getStations = async (country) => {
10
+ try {
11
+ const { data } = await axios.get(`https://de1.api.radio-browser.info/json/stations/bycountry/${country}`, {
12
+ params: { limit: 20 }
13
+ });
14
+
15
+ const stations = data.map(({ name, state, codec }) => ({
16
+ name, state: state || "unknown", codec,
17
+ }));
18
+
19
+ stations.length === 0 ? console.warn("no stations".yellow) : printTable(stations);
20
+ } catch (err) {
21
+ console.error(colors.red(err));
22
+ }
23
+ };
24
+
25
+ export default getStations;
@@ -1,5 +1,6 @@
1
1
  import axios from "axios";
2
2
  import colors from "colors";
3
+ import boxen from "boxen";
3
4
 
4
5
  /**
5
6
  * @async
@@ -12,15 +13,17 @@ export default async function magicBall(locale, question) {
12
13
  en: "magic ball say:",
13
14
  es: "la bola magic te dice:"
14
15
  };
15
-
16
+
16
17
  try {
17
18
  const {data} = await axios.get("https://eightballapi.com/api/biased", {
18
19
  params: { question, locale }
19
20
  });
20
21
 
21
- console.info(
22
- localeKeyword[locale], data.reading
23
- );
22
+ const anwser = boxen(data.reading, {
23
+ title: localeKeyword[locale],
24
+ });
25
+
26
+ console.info(anwser);
24
27
  } catch (err) {
25
28
  console.info(colors.red(err.message));
26
29
  }
package/hash/infoTools.js CHANGED
@@ -8,6 +8,7 @@ import githubInfo from "../functions/gitUser.js";
8
8
  import bundlephobia from "../functions/bundlephobia.js";
9
9
  import { returnMainOpts, TCGP_EXPANSIONS } from "../utils.js";
10
10
  import getTcgpCard from "../functions/tcgp.js";
11
+ import getStations from "../functions/getStations.js";
11
12
 
12
13
  // bitly regexp
13
14
  const bitlyRegexp = /bit\.ly\//g;
@@ -83,6 +84,16 @@ const infoTools = {
83
84
 
84
85
  getTcgpCard(setName, cardID);
85
86
 
87
+ setTimeout(refreshCallback, 5e3);
88
+ },
89
+ async getStations(refreshCallback) {
90
+ console.warn("some stations not visble only info".yellow);
91
+
92
+ const country = await input({
93
+ message: "enter country"
94
+ });
95
+
96
+ getStations(country);
86
97
  setTimeout(refreshCallback, 5e3);
87
98
  }
88
99
  };
@@ -50,6 +50,7 @@ const utilityTools = {
50
50
  message: "enter a question to the selected language:"
51
51
  });
52
52
 
53
+ console.clear();
53
54
  magicBall(localeOpt, magicBallQuestion);
54
55
  setTimeout(refreshCallback, 5e3);
55
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stack-analyze",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
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": "cli.js",
package/utils.js CHANGED
@@ -24,22 +24,16 @@ const pokerGameOpts = [
24
24
  ];
25
25
 
26
26
  /**
27
- * @readonly
28
- * @type {Object<string,number>}
27
+ *
28
+ * @constant {Object<string,number>}
29
29
  */
30
30
  const TCGP_EXPANSIONS = {
31
- "p-a": 100,
32
- a1: 286,
33
- a1a: 86,
34
- a2: 207,
35
- a2a: 96,
36
- a2b: 111,
37
- a3: 239,
38
- a3a: 103,
39
- a3b: 107,
40
- a4: 241,
41
- a4a: 105,
42
- b1: 331,
31
+ "p-a": 100, a1: 286, a1a: 86,
32
+ a2: 207, a2a: 96, a2b: 111,
33
+ a3: 239, a3a: 103, a3b: 107,
34
+ a4: 241, a4a: 105,
35
+ b1: 331, b1a: 103,
36
+ b2: 234,
43
37
  };
44
38
 
45
39
  /**