UNPKG

tainqa

Version:

Tai Nguyen's business card

47 lines (41 loc) 990 B
#!/usr/bin/env node const clear = require('clear'); const chalk = require('chalk'); const inquirer = require('inquirer'); const open = require('open'); const formatCard = require('./index'); const data = require('./lib/data'); // Clear the terminal clear(); // Display the business card console.log(formatCard()); // Display tip at the bottom console.log(chalk.gray('Tip: Try cmd/ctrl + click on the links above')); // Create interactive menu const questions = [ { type: 'list', name: 'action', message: 'What you want to do?', choices: [ { name: 'Send me an email', value: 'email' }, { name: 'Just quit.', value: 'quit' } ] } ]; inquirer.prompt(questions).then(answer => { switch (answer.action) { case 'email': open.default('mailto:me@tainqa.me'); break; case 'quit': console.log(chalk.yellow('Goodbye!')); break; } });