Comparing version 1.3.1 to 1.3.2
23
index.js
@@ -7,5 +7,26 @@ 'use strict'; | ||
var timestamp = require('time-stamp'); | ||
var supportsColor = require('color-support'); | ||
function hasFlag(flag) { | ||
return (process.argv.indexOf('--' + flag) !== -1); | ||
} | ||
function addColor(str) { | ||
if (hasFlag('no-color')) { | ||
return str; | ||
} | ||
if (hasFlag('color')) { | ||
return gray(str); | ||
} | ||
if (supportsColor()) { | ||
return gray(str); | ||
} | ||
return str; | ||
} | ||
function getTimestamp(){ | ||
return '['+gray(timestamp('HH:mm:ss'))+']'; | ||
return '['+addColor(timestamp('HH:mm:ss'))+']'; | ||
} | ||
@@ -12,0 +33,0 @@ |
{ | ||
"name": "fancy-log", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "Log things, prefixed with a timestamp", | ||
@@ -24,2 +24,3 @@ "author": "Blaine Bublitz <blaine.bublitz@gmail.com>", | ||
"ansi-gray": "^0.1.1", | ||
"color-support": "^1.1.3", | ||
"time-stamp": "^1.0.0" | ||
@@ -26,0 +27,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4633
60
3
+ Addedcolor-support@^1.1.3
+ Addedcolor-support@1.1.3(transitive)