-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththirsty.js
34 lines (32 loc) · 1.21 KB
/
thirsty.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
var schedule = require('node-schedule');
var process = require('process');
var chalk = require('chalk');
var CFonts = require('cfonts');
var inquirer = require('inquirer');
process.stdout.write('\u001bc');
CFonts.say('Water|Time!', {
font: 'block', //define the font face
align: 'left', //define text alignment
colors: ['blue'], //define all colors
background: 'Black', //define the background color
letterSpacing: 1, //define letter spacing
lineHeight: 1, //define the line height
space: true, //define if the output text should have empty lines on top and on the bottom
maxLength: '0' //define how many character can be on one line
});
var j = schedule.scheduleJob('* */2 * * *', function(){
var questions = [
{
type: 'input',
name: 'water',
message: chalk.green('Did you Drink Water 🍹 : ')
}
];
inquirer.prompt(questions).then(function (answers) {
var truth = ['y','Y','yes','Yes','yEs','yeS','YEs','yES','YeS','YES'];
var value = answers.water;
if(truth.indexOf(value) == -1)
console.log(chalk.red('Please drink water now or you\'ll get dehydrated 🚑 '));
else console.log(chalk.blue('Then let\'s code, Champ 😉!'));
});
});