Comparing version 0.1.7 to 0.1.8
65
index.js
@@ -1,40 +0,41 @@ | ||
"use strict"; | ||
var util = require( "util" ); | ||
( function(){ | ||
// colorful strings | ||
var stylize = function ( str, style ) { | ||
var styles = { | ||
"bold": [ 1, 22 ] | ||
, "italic": [ 3, 23 ] | ||
, "underline": [ 4, 24 ] | ||
, "inverse": [ 7, 27 ] | ||
, "white": [ 37, 39 ] | ||
, "grey": [ 90, 39 ] | ||
, "black": [ 90, 39 ] | ||
, "blue": [ 34, 39 ] | ||
, "cyan": [ 36, 39 ] | ||
, "green": [ 32, 39 ] | ||
, "magenta": [ 35, 39 ] | ||
, "red": [ 31, 39 ] | ||
, "yellow": [ 33, 39 ] | ||
}; | ||
return '\x1b[' + ( styles[ style ][ 0 ] ) + "m" + str + '\x1b[' + ( styles[ style ][ 1 ] ) + "m"; | ||
}; | ||
// colorful strings | ||
var stylize = function ( str, style ) { | ||
var styles = { | ||
"bold": [ 1, 22 ] | ||
, "italic": [ 3, 23 ] | ||
, "underline": [ 4, 24 ] | ||
, "inverse": [ 7, 27 ] | ||
, "white": [ 37, 39 ] | ||
, "grey": [ 90, 39 ] | ||
, "black": [ 90, 39 ] | ||
, "blue": [ 34, 39 ] | ||
, "cyan": [ 36, 39 ] | ||
, "green": [ 32, 39 ] | ||
, "magenta": [ 35, 39 ] | ||
, "red": [ 31, 39 ] | ||
, "yellow": [ 33, 39 ] | ||
}; | ||
return '\x1b[' + ( styles[ style ][ 0 ] ) + "m" + str + '\x1b[' + ( styles[ style ][ 1 ] ) + "m"; | ||
}; | ||
[ "bold", "underline", "italic", "inverse", "grey", "yellow", "red", "green", "blue", "white", "cyan", "magenta" ].forEach( function( style ) { | ||
if ( !Object.prototype.hasOwnProperty.call( String.prototype, style ) ){ | ||
Object.defineProperty( String.prototype, style, { | ||
get: function () { | ||
return stylize(this, style); | ||
} | ||
} ); | ||
} | ||
} ); | ||
} )(); | ||
[ "bold", "underline", "italic", "inverse", "grey", "yellow", "red", "green", "blue", "white", "cyan", "magenta" ].forEach( function( style ) { | ||
if ( !String[ style ] ){ | ||
Object.defineProperty( String.prototype, style, { | ||
get: function () { | ||
return stylize(this, style); | ||
} | ||
} ); | ||
} | ||
} ); | ||
var Class = require( "ee-class" ) | ||
@@ -41,0 +42,0 @@ , cluster = require( "cluster" ) |
{ | ||
"name": "ee-log" | ||
, "description": "simple & colorful console log replacement" | ||
, "version": "0.1.7" | ||
, "version": "0.1.8" | ||
, "homepage": "https://github.com/eventEmitter/ee-log" | ||
@@ -6,0 +6,0 @@ , "author": "Michael van der Weg <michael@eventemitter.com> (http://eventemitter.com/)" |
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
12476
7
267