Comparing version 2.0.3 to 2.1.0
13
index.js
@@ -17,4 +17,17 @@ exports = module.exports = require('./lib/ansi'); | ||
exports.toxic = function() { | ||
// poison the String prototype | ||
var colors = exports.color; | ||
Object.keys(colors).forEach(function(key) { | ||
var fn = colors[key]; | ||
Object.defineProperty(String.prototype, key, { | ||
get: function() { | ||
return fn(this.valueOf()); | ||
} | ||
}); | ||
}); | ||
}; | ||
Object.defineProperty(exports, 'isSupported', { | ||
get: exports.isColorSupported | ||
}); |
@@ -11,3 +11,2 @@ | ||
var tty = require('tty'); | ||
var os = require('os'); | ||
@@ -25,3 +24,3 @@ exports.disabled = false; | ||
// windows will support color | ||
if (os.type() === 'Windows_NT') return true; | ||
if (process.platform === 'win32') return true; | ||
@@ -28,0 +27,0 @@ var term = process.env.TERM; |
{ | ||
"name": "colorful", | ||
"version": "2.0.3", | ||
"version": "2.1.0", | ||
"description": "colorful if a terminal tool for colors", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -66,2 +66,14 @@ # Colorful | ||
## Toxic | ||
Let's posion the string object, just like colors does. | ||
```javascript | ||
require('colorful').toxic() | ||
'hello'.bold | ||
'hello'.red | ||
``` | ||
## Detective | ||
@@ -112,2 +124,6 @@ | ||
**2013-05-22** `2.1.0` | ||
Add toxic API. | ||
**2013-03-22** `2.0.2` | ||
@@ -114,0 +130,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
9399
202
138