-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
31 lines (29 loc) · 861 Bytes
/
App.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
#!/usr/bin/env node
var Box = require("cli-box"),
figlet = require('figlet'),
christmasDate = new Date(`Dec 25`).toJSON().slice(5,10),
newyearDate = new Date('Jan 1').toJSON().slice(5,10),
now = new Date().toJSON().slice(5,10),
chalk = require('chalk');
if(now===christmasDate){
wish('Merry Christmas')
}
else if(newyearDate===now){
wish('Happy New Year')
}
else if(now > christmasDate){
wait('New Year Is On Its Way !!')
}
else{
wait('Christmas Is On Its Way : )')
}
function wish(wishes){
figlet(wishes, (err, data) => {
if (err) throw err
console.log(chalk.bgWhite.bold(Box('90x10',{text: chalk.green(data+`\n By ${process.argv[2]||'alestor123' }`)}).toString()))})
}
function wait(waitmsg){
figlet(waitmsg, (err, data) => {
if (err) throw err
console.log(chalk.red.bgWhite.bold(data))
})}