jsfetch-term 1.0.3 → 1.0.4

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/.eslintrc.cjs CHANGED
@@ -15,5 +15,6 @@ module.exports = {
15
15
  },
16
16
  rules: {
17
17
  'no-console': 'off',
18
+ 'import/extensions': ['warn', 'always'],
18
19
  },
19
20
  };
package/README.md CHANGED
@@ -1,9 +1,14 @@
1
1
  # jsfetch
2
+
2
3
  jsfetch is a clone of [neofetch](https://github.com/dylanaraps/neofetch) written in JavaScript using NodeJS.
3
4
  jsfetch is designed to be a fan project by [@toddmcintire](https://github.com/toddmcintire) to learn more about how JavaScript and NodeJS work. It is not designed to be run in any serious capacity, if you are looking for something more stable please use [neofetch](https://github.com/dylanaraps/neofetch).
4
5
 
5
- # Installation
6
+ jsfetch currently supports Windows, Mac and Debian based Linux distros.
7
+
8
+ ## Installation
9
+
6
10
  To install globally on your machine through npm use the command
7
- ```
11
+
12
+ ```JavaScript
8
13
  npm i -g jsfetch-term
9
- ```
14
+ ```
package/bin/app.js CHANGED
@@ -11,6 +11,7 @@ import {
11
11
  version,
12
12
  } from 'node:os';
13
13
  import chalk from 'chalk';
14
+ import * as logos from './os-logos.js';
14
15
 
15
16
  /**
16
17
  * returns a number of the currently installed packages on a system.
@@ -50,11 +51,8 @@ function timeConvert(time) {
50
51
  * returns the users shell.
51
52
  */
52
53
  function shellCheck(platform) {
53
- if (platform === 'darwin') {
54
- return spawnSync(`echo`, ['"$SHELL"'], {
55
- shell: true,
56
- encoding: 'utf8',
57
- }).output[1].trim();
54
+ if (platform === 'darwin' || platform === 'linux') {
55
+ return userInfo(['utf8']).shell;
58
56
  }
59
57
  if (platform === 'win32') {
60
58
  const shell = spawnSync('$host.Name', { encoding: 'utf8' });
@@ -150,27 +148,8 @@ function getMemory(platform) {
150
148
  // }
151
149
  }
152
150
 
153
- function displayLogo(platform) {
154
- if (platform === 'darwin') {
155
- const logo = ` 'c.
156
- ,xNMM.
157
- .OMMMMo
158
- OMMM0,
159
- .;loddo:. .olloddol;.
160
- cKMMMMMMMMMMNWMMMMMMMMMM0:
161
- .KMMMMMMMMMMMMMMMMMMMMMMMWd.
162
- XMMMMMMMMMMMMMMMMMMMMMMMX.
163
- ;MMMMMMMMMMMMMMMMMMMMMMMM:
164
- :MMMMMMMMMMMMMMMMMMMMMMMM:
165
- .MMMMMMMMMMMMMMMMMMMMMMMMX.
166
- kMMMMMMMMMMMMMMMMMMMMMMMMWd.
167
- .XMMMMMMMMMMMMMMMMMMMMMMMMMMk
168
- .XMMMMMMMMMMMMMMMMMMMMMMMMK.
169
- kMMMMMMMMMMMMMMMMMMMMMMd
170
- ;KMMMMMMMWXXWMMMMMMMk.
171
- .cooc,. .,coo:.`;
172
- return logo;
173
- }
151
+ function displayLogo(OS) {
152
+ return logos[OS] || ':::OS LOGO:::';
174
153
  }
175
154
 
176
155
  const name = platform();
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Generated by https://ascii-generator.site/
3
+ * With columns of size: 50
4
+ */
5
+
6
+ const darwin = `
7
+ -+#%@-
8
+ -#@@@@@@.
9
+ :%@@@@@@@#
10
+ =@@@@@@@@%
11
+ =@@@@@@@@*
12
+ @@@@@@@*:
13
+ :@@@%*=.
14
+ :-====-:. . .:==+++==:.
15
+ :+%@@@@@@@@@@@#+-:.:-+#@@@@@@@@@@@@@#=
16
+ =%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*.
17
+ -%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#.
18
+ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*.
19
+ =@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@:
20
+ .@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.
21
+ *@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@-
22
+ %@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
23
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%
24
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
25
+ #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+
26
+ =@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@-
27
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*
28
+ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+.
29
+ %@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%+
30
+ .@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@-
31
+ :@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+
32
+ :@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+
33
+ .%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@-
34
+ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%.
35
+ :#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=
36
+ -%@@@@@@@@@@#*+===+*%@@@@@@@@@@+
37
+ `;
38
+
39
+ const linux = `
40
+ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
41
+ ░░▒▓█▓▒░░░░░░░▓▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
42
+ ░░░▒█▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
43
+ ░░░▒█▒░░░░░░░▒▓▒░░▒▓▓░▒▓▓▓░░░▒▓▒░░▒▓▓░░▒▓▓▒░░▒▓▒░░
44
+ ░░░▒█▒░░░░░░░░█▓░░░▓█▒░░░█▓░░░█▓░░░▓█░░░░▓█▒▒▓░░░░
45
+ ░░░▒█▒░░░░░░░░█▓░░░▓█░░░░█▓░░░█▓░░░▓█░░░░░▒█▓░░░░░
46
+ ░░░▒█▒░░░░▓▒░░█▓░░░▓█░░░░█▓░░░█▓░░░▓█░░░░▒▓░▓█░░░░
47
+ ░░▒▓▓▓▒▒▒▓▓░░▒▓▓▒░▒▓▓▒░░▒▓▓▒░░▒▓▓▒▒▒▓▒░▒▓▓░░░▓▓▒░░`;
48
+
49
+ const win32 = `
50
+ .....
51
+ .....@@@@@@@@@@
52
+ ....@@@@@@@@@@@@@@@@@@@@@
53
+ .... @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
54
+ ...@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
55
+ @@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
56
+ @@@@@@@@@@@@@@@@@@. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
57
+ @@@@@@@@@@@@@@@@@@. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
58
+ @@@@@@@@@@@@@@@@@@. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
59
+ @@@@@@@@@@@@@@@@@@. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
60
+ @@@@@@@@@@@@@@@@@@. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
61
+ @@@@@@@@@@@@@@@@@@. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
62
+ @@@@@@@@@@@@@@@@@@. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
63
+
64
+ @@@@@@@@@@@@@@@@@@ @@@@@@@@.....................
65
+ @@@@@@@@@@@@@@@@@@. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
66
+ @@@@@@@@@@@@@@@@@@. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
67
+ @@@@@@@@@@@@@@@@@@. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
68
+ @@@@@@@@@@@@@@@@@@. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
69
+ @@@@@@@@@@@@@@@@@@. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
70
+ @@@@@@@@@@@@@@@@@@. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
71
+ @@@@@@@@@@@@@@@@@@. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
72
+ .@@@@@@@@@@@@@@@@@. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
73
+ ..@@@@@@@. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
74
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
75
+ ..@@@@@@@@@@@@@@@@@@@
76
+ ...@@@@@@@@`
77
+
78
+ export { darwin, linux, win32 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsfetch-term",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "neofetch clone in javascript",
5
5
  "main": "app.js",
6
6
  "type": "module",