UNPKG

pranilism

Version:

About me packages

74 lines (63 loc) 3.59 kB
const readline = require('readline').createInterface({ input: process.stdin, output: process.stdout }); const openurl = require('openurl'); const NameArray = [ [1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0], [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0], [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0], [1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0], [1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0], [1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0], [1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0], ]; function askQuestionToUser() { console.clear(); console.log('Hello It\'s, '); for (let i = 0; i < NameArray.length; i++) { const outer_ele = NameArray[i]; for (let j = 0; j < outer_ele.length; j++) { const inner_ele = outer_ele[j]; if (inner_ele == 1) process.stdout.write('▓'); else process.stdout.write(' '); } process.stdout.write('\n'); } console.log(); var msg = `Hey ${getTimeStatus()} Dude !!\nWhat do you want to get about me ?\n1) Facebook\n2) Email\n3) Linked in\n4) Github\n5) Stack Overflow\nEnter your choice here : `; readline.question(msg, choice => { openurl.open('https://pranilism.github.io/') switch (parseInt(choice)) { case 1: openurl.open('https://www.facebook.com/pranilism') break; case 2: openurl.open('mailto:praniltunga@gmail.com') break; case 3: openurl.open('https://www.linkedin.com/in/pranil-tunga-b99456135') break; case 4: openurl.open('https://github.com/pranilism') break; case 5: openurl.open('https://stackoverflow.com/users/11372040/pranil-tunga') break; case 6: console.log('Wish you and your family a very happy life\nStay connected, Stay coding :) :)\n'); break; default: console.log(`\nAre you kidding me ? :) you inserted wrong value :) :)\n`) } console.log('b byee, Have a good day to you and your family :) Stay Happy, Stay Coding :)\n'); readline.close(); }); } function getTimeStatus() { var today = new Date() var curHr = today.getHours() if (curHr < 12) { return 'good morning'; } else if (curHr < 18) { return 'good afternoon'; } else { return 'good evening'; } } module.exports = askQuestionToUser;