From ffb8876aafc59366586ef94be090b89a94da6e01 Mon Sep 17 00:00:00 2001 From: Veselin Todorov Date: Sat, 21 Jan 2012 15:34:48 +0200 Subject: [PATCH] Adding colors as dep and adding colors in the output. --- bin/bot | 9 +++++---- package.json | 3 +-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/bot b/bin/bot index 67f06a8..4f4aa5e 100755 --- a/bin/bot +++ b/bin/bot @@ -11,6 +11,7 @@ * Module dependencies. */ var readline = require('readline'); +var colors = require('colors'); /** * Bot class. @@ -45,14 +46,14 @@ var bot = new Bot(new Db, defaults); * * @type {String} */ -var nick = 'Bot: '; +var nick = 'Bot: '.cyan; /** * Your nickname. * * @type {String} */ -var you = 'You: '; +var you = 'You: '.magenta; /** * Exit cmd. @@ -72,7 +73,7 @@ var rl = readline.createInterface(process.stdin, process.stdout) rl.on('line', function(line) { if (line.trim() === 'exit') return rl.emit('close'); console.log(nick + bot.answer(line)); - rl.setPrompt(you, you.length); + rl.setPrompt(you, you.length - 10); rl.prompt(); }); @@ -84,5 +85,5 @@ rl.on('close', function() { // Greeting. console.log(nick + 'Good to see you here, dude. Let\'s talk.'); -rl.setPrompt(you, you.length); +rl.setPrompt(you, you.length - 10); rl.prompt(); \ No newline at end of file diff --git a/package.json b/package.json index 6835382..d44c863 100644 --- a/package.json +++ b/package.json @@ -6,12 +6,11 @@ , "keywords": ["bot", "chat bot"] , "author": "Veselin Todorov " , "dependencies": { - "flatiron": "~0.1.7" + "colors": "0.6.0-1" } , "devDependencies": { "mocha": "0.3.3" , "should": "0.3.2" - , "sinon": "1.3.1" } , "repository" : { "type" : "git"