Skip to content

Commit 88c5aeb

Browse files
committed
Update: Replace chalk module with ansi-gray
1 parent a9dbe42 commit 88c5aeb

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
/*
33
Initial code from https://github.com/gulpjs/gulp-util/blob/v3.0.6/lib/log.js
44
*/
5-
var chalk = require('chalk');
5+
var gray = require('ansi-gray');
66
var timestamp = require('time-stamp');
77

88
function getTimestamp(){
9-
return '['+chalk.grey(timestamp('HH:mm:ss'))+']';
9+
return '['+gray(timestamp('HH:mm:ss'))+']';
1010
}
1111

1212
function log(){

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"test": "lab -cvL test.js"
2121
},
2222
"dependencies": {
23-
"chalk": "^1.1.1",
23+
"ansi-gray": "^0.1.1",
2424
"time-stamp": "^1.0.0"
2525
},
2626
"devDependencies": {

test.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var util = require('util');
66

77
var lab = exports.lab = require('lab').script();
88
var code = require('code');
9-
var chalk = require('chalk');
9+
var gray = require('ansi-gray');
1010
var timestamp = require('time-stamp');
1111

1212
var log = require('./');
@@ -31,7 +31,7 @@ lab.describe('log()', function(){
3131

3232
log(1, 2, 3, 4, 'five');
3333
var time = timestamp('HH:mm:ss');
34-
code.expect(writtenValue).equals('[' + chalk.grey(time) + '] 1 2 3 4 \'five\'\n');
34+
code.expect(writtenValue).equals('[' + gray(time) + '] 1 2 3 4 \'five\'\n');
3535

3636
// Restore process.stdout.write after test
3737
process.stdout.write = stdout_write;
@@ -46,7 +46,7 @@ lab.describe('log()', function(){
4646
log('%s %d %j', 'something', 0.1, {key: 'value'});
4747
var time = timestamp('HH:mm:ss');
4848
code.expect(writtenValue).equals(
49-
'[' + chalk.grey(time) + '] '+
49+
'[' + gray(time) + '] '+
5050
'something 0.1 {\"key\":\"value\"}\n'
5151
);
5252

@@ -77,7 +77,7 @@ lab.describe('log.info()', function(){
7777

7878
log.info(1, 2, 3, 4, 'five');
7979
var time = timestamp('HH:mm:ss');
80-
code.expect(writtenValue).equals('[' + chalk.grey(time) + '] 1 2 3 4 \'five\'\n');
80+
code.expect(writtenValue).equals('[' + gray(time) + '] 1 2 3 4 \'five\'\n');
8181

8282
// Restore process.stdout.write after test
8383
process.stdout.write = stdout_write;
@@ -92,7 +92,7 @@ lab.describe('log.info()', function(){
9292
log.info('%s %d %j', 'something', 0.1, {key: 'value'});
9393
var time = timestamp('HH:mm:ss');
9494
code.expect(writtenValue).equals(
95-
'[' + chalk.grey(time) + '] '+
95+
'[' + gray(time) + '] '+
9696
'something 0.1 {\"key\":\"value\"}\n'
9797
);
9898

@@ -124,7 +124,7 @@ lab.describe('log.dir()', function(){
124124
log.dir({key: 'value'});
125125
var time = timestamp('HH:mm:ss');
126126
code.expect(writtenValue).equals(
127-
'[' + chalk.grey(time) + '] '+
127+
'[' + gray(time) + '] '+
128128
util.inspect({key:'value'}) + '\n'
129129
);
130130

@@ -155,7 +155,7 @@ lab.describe('log.warn()', function(){
155155

156156
log.warn(1, 2, 3, 4, 'five');
157157
var time = timestamp('HH:mm:ss');
158-
code.expect(writtenValue).equals('[' + chalk.grey(time) + '] 1 2 3 4 \'five\'\n');
158+
code.expect(writtenValue).equals('[' + gray(time) + '] 1 2 3 4 \'five\'\n');
159159

160160
// Restore process.stderr.write after test
161161
process.stderr.write = stderr_write;
@@ -170,7 +170,7 @@ lab.describe('log.warn()', function(){
170170
log.warn('%s %d %j', 'something', 0.1, {key: 'value'});
171171
var time = timestamp('HH:mm:ss');
172172
code.expect(writtenValue).equals(
173-
'[' + chalk.grey(time) + '] '+
173+
'[' + gray(time) + '] '+
174174
'something 0.1 {\"key\":\"value\"}\n'
175175
);
176176

@@ -201,7 +201,7 @@ lab.describe('log.error()', function(){
201201

202202
log.error(1, 2, 3, 4, 'five');
203203
var time = timestamp('HH:mm:ss');
204-
code.expect(writtenValue).equals('[' + chalk.grey(time) + '] 1 2 3 4 \'five\'\n');
204+
code.expect(writtenValue).equals('[' + gray(time) + '] 1 2 3 4 \'five\'\n');
205205

206206
// Restore process.stderr.write after test
207207
process.stderr.write = stderr_write;
@@ -216,7 +216,7 @@ lab.describe('log.error()', function(){
216216
log.error('%s %d %j', 'something', 0.1, {key: 'value'});
217217
var time = timestamp('HH:mm:ss');
218218
code.expect(writtenValue).equals(
219-
'[' + chalk.grey(time) + '] '+
219+
'[' + gray(time) + '] '+
220220
'something 0.1 {\"key\":\"value\"}\n'
221221
);
222222

0 commit comments

Comments
 (0)