stack-analyze 1.3.2 → 1.3.3

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
@@ -4,6 +4,12 @@ stack-analyze all version and notable changes, fixed, remove and new additions i
4
4
 
5
5
  ## generation 4 (ver. 1.3.0 - )
6
6
 
7
+ ### version 1.3.3
8
+ #### Added
9
+ - add potter search (harry potter npx characters)
10
+ #### changed
11
+ - update linter
12
+
7
13
  ### version 1.3.2
8
14
  #### Added
9
15
  - title for stack menu tools
@@ -0,0 +1,44 @@
1
+ import path from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ import globals from "globals";
4
+ import js from "@eslint/js";
5
+ import { FlatCompat } from "@eslint/eslintrc";
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = path.dirname(__filename);
9
+ const compat = new FlatCompat({
10
+ baseDirectory: __dirname,
11
+ recommendedConfig: js.configs.recommended,
12
+ allConfig: js.configs.all
13
+ });
14
+
15
+ export default [{
16
+ ignores: ["node_modules", "test", "docs", "eslint.config.js"],
17
+ }, ...compat.extends("eslint:recommended"), {
18
+ languageOptions: {
19
+ globals: {
20
+ ...globals.commonjs,
21
+ ...globals.node,
22
+ },
23
+ ecmaVersion: "latest",
24
+ sourceType: "module",
25
+ },
26
+
27
+ rules: {
28
+ "no-var": "error",
29
+ eqeqeq: "warn",
30
+ "default-case": "error",
31
+ "eol-last": "error",
32
+ "spaced-comment": "error",
33
+ "comma-spacing": "error",
34
+ quotes: "error",
35
+ "block-spacing": "error",
36
+ "prefer-const": "error",
37
+
38
+ indent: ["error", 2, {
39
+ SwitchCase: 1,
40
+ }],
41
+
42
+ semi: "error",
43
+ },
44
+ }];
@@ -11,29 +11,27 @@ import { stackSave } from "../utils.js";
11
11
  * @returns {Promise<void>}
12
12
  */
13
13
  export default async function deezer(q) {
14
- try {
15
- const { data } = await axios.get(
16
- "https://api.deezer.com/search/album", {
17
- params: { q }
18
- }
19
- );
20
-
21
- const results = data.data.map(({
22
- id, title, record_type,
23
- explicit_lyrics, artist, nb_tracks
24
- }) => ({
25
- id,
26
- artist: artist.name,
27
- title,
28
- type: record_type,
29
- num_tracks: nb_tracks,
30
- lyrics_content: explicit_lyrics ? "explicit" : "clean"
31
- }));
32
-
33
- printTable(results.slice(0, 15));
34
-
35
- stackSave("album-search.json", JSON.stringify(data.data, null, 2));
36
- } catch(err) {
37
- console.error(colors.red(err.message));
38
- }
14
+ try {
15
+ const { data } = await axios.get("https://api.deezer.com/search/album", {
16
+ params: { q }
17
+ });
18
+
19
+ const results = data.data.map(({
20
+ id, title, record_type,
21
+ explicit_lyrics, artist, nb_tracks
22
+ }) => ({
23
+ id,
24
+ artist: artist.name,
25
+ title,
26
+ type: record_type,
27
+ num_tracks: nb_tracks,
28
+ lyrics_content: explicit_lyrics ? "explicit" : "clean"
29
+ }));
30
+
31
+ printTable(results.slice(0, 15));
32
+
33
+ stackSave("album-search.json", JSON.stringify(data.data, null, 2));
34
+ } catch(err) {
35
+ console.error(colors.red(err.message));
36
+ }
39
37
  }
@@ -0,0 +1,27 @@
1
+ import axios from "axios";
2
+ import colors from "colors";
3
+
4
+ /**
5
+ * @description search harry potter characters using keyword or name
6
+ * @async
7
+ * @param { string } search - get results of harry potter characters
8
+ * @returns { Promise<void>}
9
+ */
10
+ export default async function potterSearch(search) {
11
+ try {
12
+ const { data } = await axios.get("https://potterapi-fedeperin.vercel.app/en/characters", {
13
+ params: { search }
14
+ });
15
+
16
+ const characterList = data.map(({
17
+ nickname, fullName, hogwartsHouse, birthdate
18
+ }) => ({
19
+ nickname, fullName, birthdate,
20
+ house: hogwartsHouse,
21
+ }));
22
+
23
+ console.table(characterList);
24
+ } catch(err) {
25
+ console.error(colors.red(err.message));
26
+ }
27
+ }
@@ -7,6 +7,7 @@ import movieDB from "../functions/moviesInfo.js";
7
7
  import pokemonInfo from "../functions/pokemon.js";
8
8
  import twitchInfo from "../functions/twitch.js";
9
9
  import deezer from "../functions/deezer.js";
10
+ import potterSearch from "../functions/potterSearch.js";
10
11
 
11
12
  // fields
12
13
  import {
@@ -98,9 +99,20 @@ const queryTools = {
98
99
  promptParams("query", "enter a query for search")
99
100
  ])
100
101
  .then(({ query }) => {
101
- deezer(query)
102
+ deezer(query);
102
103
  setTimeout(refreshCallback, 5e3);
103
- })
104
+ });
105
+ },
106
+ potter_search(refreshCallback) {
107
+ console.clear();
108
+
109
+ inquirer.prompt([
110
+ promptParams("search", "enter a keyword or name for search")
111
+ ])
112
+ .then(({ search }) => {
113
+ potterSearch(search);
114
+ setTimeout(refreshCallback, 5e3);
115
+ });
104
116
  }
105
117
  };
106
118
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stack-analyze",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
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",
@@ -8,29 +8,31 @@
8
8
  "stack-analyze": "cli.js"
9
9
  },
10
10
  "dependencies": {
11
- "axios": "^1.6.8",
12
- "boxen": "^7.1.1",
13
- "cheerio": "^1.0.0-rc.12",
11
+ "axios": "^1.7.7",
12
+ "boxen": "^8.0.1",
13
+ "cheerio": "^1.0.0",
14
14
  "cli-progress": "^3.12.0",
15
15
  "colors": "^1.4.0",
16
- "console-table-printer": "^2.12.0",
17
- "figlet": "^1.7.0",
18
- "gauge": "^5.0.1",
19
- "inquirer": "^9.2.20",
20
- "systeminformation": "^5.22.7",
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
21
  "timeago.js": "^4.0.2",
22
22
  "w3c-css-validator": "^1.3.2",
23
23
  "wapalyzer": "^6.10.65"
24
24
  },
25
25
  "devDependencies": {
26
- "eslint": "^9.1.1",
27
- "jsdoc": "^4.0.2"
26
+ "@eslint/js": "^9.14.0",
27
+ "eslint": "^9.14.0",
28
+ "globals": "^15.12.0",
29
+ "jsdoc": "^4.0.4"
28
30
  },
29
31
  "scripts": {
30
32
  "start": "node cli.js",
31
33
  "test": "node --test test/index.test.js",
32
- "lint:test": "eslint . --ext .js,.cjs,.mjs",
33
- "lint:fix": "eslint . --ext .js,.cjs,.mjs --fix",
34
+ "lint:test": "eslint -c eslint.config.js",
35
+ "lint:fix": "eslint -c eslint.config.js",
34
36
  "docs": "jsdoc -c jsdoc.json"
35
37
  },
36
38
  "repository": {
package/utils.js CHANGED
@@ -26,7 +26,7 @@ const menuInfoOpts = [
26
26
 
27
27
  const menuQueryOpts = [
28
28
  "anime_Search", "movie_info", "pokemon_info",
29
- "twitch_info", "deezer", returnMainOpts
29
+ "twitch_info", "deezer", "potter_search", returnMainOpts
30
30
  ];
31
31
 
32
32
  const menuUtilityOpts = [