brianmmaina 1.1.9 → 1.1.10

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.
Files changed (2) hide show
  1. package/index.js +62 -53
  2. package/package.json +4 -1
package/index.js CHANGED
@@ -1,43 +1,54 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
3
- import inquirer from 'inquirer';
4
- import open from 'open';
5
- import figlet from 'figlet';
6
- import chalk from 'chalk';
7
- import chalkAnimation from 'chalk-animation';
8
- import boxen from 'boxen';
9
- import gradient from 'gradient-string';
10
- import Table from 'cli-table3';
11
- import { createSpinner } from 'nanospinner';
2
+ 'use strict'
12
3
 
13
- // Placeholder URLs - replace with actual ones
14
- const resumeUrl = 'https://drive.google.com/your-resume-link';
15
- const githubUrl = 'https://github.com/your-github';
4
+ import chalk from 'chalk'
5
+ import boxen from 'boxen'
6
+ import clear from 'clear'
7
+ import inquirer from 'inquirer'
8
+ import Enquirer from 'enquirer'
9
+ import gradient from 'gradient-string'
10
+ import Table from 'cli-table3'
11
+ import { createSpinner } from 'nanospinner'
12
+ import open from 'open'
13
+
14
+ import fs from 'fs'
15
+ import { fileURLToPath } from 'url'
16
+ import { dirname } from 'path'
17
+ import * as path from 'path'
18
+ const __filename = fileURLToPath(import.meta.url);
19
+ const __dirname = dirname(__filename);
16
20
 
17
21
  const sleep = (ms = 2000) => new Promise((r) => setTimeout(r, ms));
18
22
 
19
- const showIntro = async () => {
20
- console.clear();
21
- const msg = 'Brian Maina';
23
+ // Placeholder URLs - replace with actual ones
24
+ const resumeUrl = 'https://drive.google.com/your-resume-link';
25
+ const githubUrl = 'https://github.com/your-github';
22
26
 
23
- return new Promise((resolve) => {
24
- figlet(msg, (err, data) => {
25
- console.log(gradient.pastel.multiline(data) + '\n');
27
+ const data = {
28
+ name: chalk.bold.green('Brian Maina'),
29
+ website: chalk.green('👨‍💻 Full Stack Developer'),
30
+ labelWebsite: chalk.white('Role:'),
31
+ github: chalk.green('github.com/brianmmaina'),
32
+ labelGithub: chalk.white('GitHub:'),
33
+ email: chalk.green('brian@example.com'),
34
+ labelEmail: chalk.white('Email:')
35
+ }
26
36
 
27
- const intro = gradient.cristal('Hi, I\'m Brian Maina! A passionate developer who loves coding, movies, and video games.');
28
- const box = boxen(intro, {
29
- padding: 1,
30
- margin: 1,
31
- borderStyle: 'double',
32
- borderColor: 'cyan',
33
- backgroundColor: '#000',
34
- float: 'center'
35
- });
36
- console.log(box);
37
- resolve();
38
- });
39
- });
40
- };
37
+ const card = boxen(
38
+ [
39
+ `${data.name}`,
40
+ ``,
41
+ `${data.labelWebsite} ${data.website}`,
42
+ `${data.labelGithub} ${data.github}`,
43
+ `${data.labelEmail} ${data.email}`
44
+ ].join('\n'),
45
+ {
46
+ margin: 1,
47
+ padding: 1,
48
+ borderStyle: 'double',
49
+ borderColor: 'green'
50
+ }
51
+ );
41
52
 
42
53
  const questions = [
43
54
  {
@@ -66,7 +77,6 @@ const questions = [
66
77
  {
67
78
  name: `🎵 Play Song with Dance`,
68
79
  value: async () => {
69
- console.clear();
70
80
  console.log(gradient.fruit('🎵 Now playing: "Your Favorite Song" 🎵\n'));
71
81
 
72
82
  const frames = [
@@ -150,7 +160,6 @@ const questions = [
150
160
  {
151
161
  name: `🏓 Play Ping Pong`,
152
162
  value: async () => {
153
- console.clear();
154
163
  console.log(gradient.fruit('🏓 Ping Pong Championship! 🏓\n'));
155
164
  console.log('Controls: A/D to move paddle, Q to quit\n');
156
165
 
@@ -224,7 +233,6 @@ const questions = [
224
233
  {
225
234
  name: `💼 View Skills & Portfolio`,
226
235
  value: async () => {
227
- console.clear();
228
236
  console.log(gradient.fruit('💼 My Skills & Portfolio 💼\n'));
229
237
 
230
238
  const table = new Table({
@@ -252,7 +260,6 @@ const questions = [
252
260
  {
253
261
  name: `📞 Contact Info`,
254
262
  value: async () => {
255
- console.clear();
256
263
  console.log(gradient.fruit('📞 Contact Information 📞\n'));
257
264
 
258
265
  const contactTable = new Table({
@@ -271,38 +278,40 @@ const questions = [
271
278
  {
272
279
  name: `🚪 Exit`,
273
280
  value: () => {
274
- console.log(gradient.pastel('Thanks for visiting! Goodbye! 👋'));
275
- process.exit(0);
281
+ console.log(gradient.pastel("Have a nice day!\n"));
282
+ process.exit();
276
283
  }
277
284
  }
278
285
  ]
279
286
  }
280
287
  ];
281
288
 
289
+ const prompt = inquirer.createPromptModule();
290
+
282
291
  const followup = [
283
292
  {
284
- type: "confirm",
285
- name: "continue",
286
- message: "Would you like to explore more?",
287
- default: true
293
+ type: "toggle",
294
+ name: "exit",
295
+ message: "Exit?",
296
+ enabled: 'Yes',
297
+ disabled: 'No',
298
+ default: false
288
299
  }
289
300
  ];
290
301
 
291
- const prompt = inquirer.createPromptModule();
292
-
293
302
  async function init() {
294
- await showIntro();
303
+ clear();
304
+ console.log(card);
295
305
  await prompt(questions).then(answer => answer.action());
296
- await prompt(followup).then(answer => {
297
- if (answer.continue) {
306
+ await Enquirer.prompt(followup).then(answer => {
307
+ if (!answer.exit) {
298
308
  init();
299
309
  } else {
300
- console.log(gradient.pastel('Thanks for exploring! Goodbye! 👋'));
301
- process.exit(0);
310
+ console.log(gradient.pastel("Have a nice day!\n"));
311
+ process.exit();
302
312
  }
303
313
  });
304
314
  }
305
315
 
306
- (async () => {
307
- await init();
308
- })();
316
+ process.removeAllListeners('warning');
317
+ init();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brianmmaina",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "description": "My terminal business card",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -16,8 +16,11 @@
16
16
  "license": "ISC",
17
17
  "dependencies": {
18
18
  "boxen": "^8.0.1",
19
+ "chalk": "^5.3.0",
19
20
  "chalk-animation": "^2.0.3",
20
21
  "cli-table3": "^0.6.5",
22
+ "clear": "^0.1.0",
23
+ "enquirer": "^2.4.1",
21
24
  "figlet": "^1.10.0",
22
25
  "gradient-string": "^3.0.0",
23
26
  "inquirer": "^13.2.5",