This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const colors = require('colors'); | |
const greet = require("../lib/greet"); | |
// print random greeting | |
console.log( | |
// wraps text with rainbow color formatting | |
colors.rainbow( | |
// returns the random greeting text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _ = require("lodash"); | |
const GREETINGS = { | |
en: "Good Morning", | |
de: "Guten Morgen", | |
fr: "Bonjour", | |
ru: "Dobre Utra", | |
kr: "Annyeonghaseyo" | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const colors = require('colors'); | |
const greet = require("../lib/greet"); | |
// get arguments after first two elements in process.argv | |
var arguments = process.argv.splice(2); | |
// check if user want language specific greeting | |
// default value of language is `null` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var | |
gulp = require('gulp'), | |
markdown = require('gulp-markdown'), | |
highlight = require('gulp-highlight') | |
; | |
/*************************************************/ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// coffee types | |
exports.types = [ | |
{name: 'Espresso', price: '$5.99'}, | |
{name: 'Latte', price: '$4.50'}, | |
{name: 'Cappuchino', price: '$3.99'}, | |
{name: 'Americano', price: '$2.50'}, | |
{name: 'Macchiato', price: '$3.50'}, | |
]; | |
exports.typesPlain = exports.types.map(function(o) { | |
return o.name + ' (' + o.price + ')'; // convert to one line |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const colors = require('colors'); | |
const { types } = require('./values'); | |
// export function to list coffee | |
module.exports = function() { | |
console.log('COFFEE MENU'); | |
console.log('------------------'); | |
// list on separate lines | |
types.forEach((type) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const program = require('commander'); | |
// import function to list coffee menu | |
const list = require('../lib/list'); | |
/*******************************************/ | |
// Print coffee drinks menu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const program = require('commander'); | |
const colors = require('colors'); | |
/*******************************************/ | |
// Order a coffee | |
// $ coffee-shop order type arguments | |
// $ coffee-shop o type arguments |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const inquirer = require('inquirer'); | |
const values = require('../lib/values'); | |
const questions = [ | |
{ type: 'list', name: 'coffeType', message: 'Choose coffee type', choices: values.typesPlain }, | |
{ type: 'list', name: 'sugarLevel', message: 'Choose your sugar level', choices: values.sugarPlain }, | |
{ type: 'confirm', name: 'decaf', message: 'Do you prefer your coffee to be decaf?', default: false }, | |
{ type: 'confirm', name: 'cold', message: 'Do you prefer your coffee to be cold?', default: false }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const program = require('commander'); | |
// import function to list coffeee menu | |
const list = require('../lib/list'); | |
// import function to order a coffee | |
const order = require('../lib/order'); |