Skip to content
This repository was archived by the owner on Dec 20, 2018. It is now read-only.

Commit d854d9f

Browse files
committed
Switch from colors to chalk
1 parent 291467d commit d854d9f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/xbox.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var HID = require('node-hid'),
22
util = require('util'),
3-
colors = require('colors'),
3+
chalk = require('chalk'),
44
events = require('events');
55

66
var dead = 6000;
@@ -113,7 +113,7 @@ XboxController.prototype.loadController = function() {
113113
HID.devices().forEach((function(d) {
114114
if(typeof d === 'object' && d.product.toLowerCase().indexOf('controller') !== -1) {
115115
this.hid = new HID.HID(d.path);
116-
console.log( 'notice: '.green, 'Xbox controller connected.' );
116+
console.log( chalk.green('notice: '), 'Xbox controller connected.' );
117117
}
118118
}).bind(this));
119119

@@ -127,14 +127,14 @@ XboxController.prototype.loadController = function() {
127127
this.hid.read(this.interpretData.bind(this));
128128
}
129129
catch ( ex ) {
130-
console.log( 'error: '.red, 'Xbox controller could not be found.' );
130+
console.log( chalk.red('error: '), 'Xbox controller could not be found.' );
131131
}
132132

133133
};
134134

135135
XboxController.prototype.interpretData = function(error, data) {
136136
if(error && this.hid) {
137-
console.log('error:'.red, error);
137+
console.log(chalk.red('error:'), error);
138138
this.hid = false;
139139
this.loadController();
140140
return false;
@@ -202,7 +202,7 @@ XboxController.prototype.sendCommand = function(command, errorMsg) {
202202
this.hid.write(command);
203203
}
204204
catch ( ex ){
205-
console.log( 'error: '.red, errorMsg );
205+
console.log( chalk.red('error: '), errorMsg );
206206
}
207207
};
208208

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"main": "./lib/xbox.js",
3030
"dependencies": {
3131
"node-hid": "~>0.2.3",
32-
"colors": "~>0.6.2"
32+
"chalk": "~0.3.0"
3333
},
3434
"scripts": {
3535
"test": "node ./tests/test.js"

0 commit comments

Comments
 (0)