-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
37 lines (28 loc) · 798 Bytes
/
index.js
1
2
3
4
5
6
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
import figlet from "figlet";
import inquirer from "inquirer";
import gradient from "gradient-string";
// const figlet = require('figlet');
// const inquirer = require('inquirer');
// const gradient = require('gradient-string');
let username;
const greet = async () => {
try {
figlet("My CLI", function (err, data) {
console.log(data);
});
const { name } = await inquirer.prompt({
type: 'input',
name: 'name',
message: 'Enter Your Name'
});
username = name;
const msg = `Hello ${username}!`;
figlet(msg, (err, data) => {
if (!err) {
console.log(gradient.pastel.multiline(data));
}
})
}
catch (e) { console.log(e) }
};
greet();