looks like I garbled the last patch, this one works better:
diff -cr -x '*.git' colors.js-1.1.2/debian/changelog colors.js-1.2.4/debian/changelog *** colors.js-1.1.2/debian/changelog 2018-10-08 16:44:05.000000000 +0000 --- colors.js-1.2.4/debian/changelog 2018-10-08 16:48:54.959668251 +0000 *************** *** 1,3 **** --- 1,9 ---- + colors.js (1.2.4-1) UNRELEASED; urgency=medium + + * New upstream version 1.2.4-1 + + -- Jeffrey Cliff <jeffrey.cl...@gmail.com> Mon, 08 Oct 2018 09:57:02 +0500 + colors.js (1.1.2-1) unstable; urgency=medium * New upstream version 1.1.2 diff -cr -x '*.git' colors.js-1.1.2/debian/control colors.js-1.2.4/debian/control *** colors.js-1.1.2/debian/control 2018-10-08 16:44:05.000000000 +0000 --- colors.js-1.2.4/debian/control 2018-10-08 16:46:38.563887826 +0000 *************** *** 11,16 **** Package: node-colors Architecture: all ! Depends: ${misc:Depends}, nodejs Description: Get color and style in your node.js console This package contains the NodeJS module. --- 11,16 ---- Package: node-colors Architecture: all ! Depends: ${misc:Depends}, nodejs(>= 0.1.90) Description: Get color and style in your node.js console This package contains the NodeJS module. Only in colors.js-1.2.4/debian: .debhelper Only in colors.js-1.2.4/debian: files Only in colors.js-1.2.4/debian: node-colors.substvars Only in colors.js-1.2.4: .eslintrc.json diff -cr -x '*.git' colors.js-1.1.2/examples/normal-usage.js colors.js-1.2.4/examples/normal-usage.js *** colors.js-1.1.2/examples/normal-usage.js 2015-06-17 13:01:51.000000000 +0000 --- colors.js-1.2.4/examples/normal-usage.js 2018-10-08 16:23:36.922055319 +0000 *************** *** 1,34 **** var colors = require('../lib/index'); ! console.log("First some yellow text".yellow); ! console.log("Underline that text".yellow.underline); ! console.log("Make it bold and red".red.bold); ! console.log(("Double Raindows All Day Long").rainbow) ! console.log("Drop the bass".trap) ! console.log("DROP THE RAINBOW BASS".trap.rainbow) ! console.log('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported ! ! console.log('So '.green + 'are'.underline + ' ' + 'inverse'.inverse + ' styles! '.yellow.bold); // styles not widely supported ! console.log("Zebras are so fun!".zebra); // // Remark: .strikethrough may not work with Mac OS Terminal App // ! console.log("This is " + "not".strikethrough + " fun."); ! console.log('Background color attack!'.black.bgWhite) ! console.log('Use random styles on everything!'.random) ! console.log('America, Heck Yeah!'.america) ! console.log('Setting themes is useful') // // Custom themes --- 1,36 ---- var colors = require('../lib/index'); ! console.log('First some yellow text'.yellow); ! console.log('Underline that text'.yellow.underline); ! console.log('Make it bold and red'.red.bold); ! console.log(('Double Raindows All Day Long').rainbow); ! console.log('Drop the bass'.trap); ! console.log('DROP THE RAINBOW BASS'.trap.rainbow); + // styles not widely supported + console.log('Chains are also cool.'.bold.italic.underline.red); ! // styles not widely supported ! console.log('So '.green + 'are'.underline + ' ' + 'inverse'.inverse ! + ' styles! '.yellow.bold); ! console.log('Zebras are so fun!'.zebra); // // Remark: .strikethrough may not work with Mac OS Terminal App // ! console.log('This is ' + 'not'.strikethrough + ' fun.'); ! console.log('Background color attack!'.black.bgWhite); ! console.log('Use random styles on everything!'.random); ! console.log('America, Heck Yeah!'.america); ! console.log('Setting themes is useful'); // // Custom themes *************** *** 45,74 **** help: 'cyan', warn: 'yellow', debug: 'blue', ! error: 'red' }); // outputs red text ! console.log("this is an error".error); // outputs yellow text ! console.log("this is a warning".warn); // outputs grey text ! console.log("this is an input".input); console.log('Generic logging theme as file'.green.bold.underline); // Load a theme from file ! colors.setTheme(__dirname + '/../themes/generic-logging.js'); // outputs red text ! console.log("this is an error".error); // outputs yellow text ! console.log("this is a warning".warn); // outputs grey text ! console.log("this is an input".input); - //console.log("Don't summon".zalgo) \ No newline at end of file --- 47,81 ---- help: 'cyan', warn: 'yellow', debug: 'blue', ! error: 'red', }); // outputs red text ! console.log('this is an error'.error); // outputs yellow text ! console.log('this is a warning'.warn); // outputs grey text ! console.log('this is an input'.input); console.log('Generic logging theme as file'.green.bold.underline); // Load a theme from file ! try { ! colors.setTheme(require(__dirname + '/../themes/generic-logging.js')); ! } catch (err) { ! console.log(err); ! } // outputs red text ! console.log('this is an error'.error); // outputs yellow text ! console.log('this is a warning'.warn); // outputs grey text ! console.log('this is an input'.input); ! ! // console.log("Don't summon".zalgo) diff -cr -x '*.git' colors.js-1.1.2/examples/safe-string.js colors.js-1.2.4/examples/safe-string.js *** colors.js-1.1.2/examples/safe-string.js 2015-06-17 13:01:51.000000000 +0000 --- colors.js-1.2.4/examples/safe-string.js 2018-10-08 16:23:36.922055319 +0000 *************** *** 1,37 **** var colors = require('../safe'); ! console.log(colors.yellow("First some yellow text")); ! console.log(colors.yellow.underline("Underline that text")); ! console.log(colors.red.bold("Make it bold and red")); ! console.log(colors.rainbow("Double Raindows All Day Long")) ! console.log(colors.trap("Drop the bass")) ! console.log(colors.rainbow(colors.trap("DROP THE RAINBOW BASS"))); ! console.log(colors.bold.italic.underline.red('Chains are also cool.')); // styles not widely supported ! console.log(colors.green('So ') + colors.underline('are') + ' ' + colors.inverse('inverse') + colors.yellow.bold(' styles! ')); // styles not widely supported ! console.log(colors.zebra("Zebras are so fun!")); ! ! console.log("This is " + colors.strikethrough("not") + " fun."); console.log(colors.black.bgWhite('Background color attack!')); ! console.log(colors.random('Use random styles on everything!')) console.log(colors.america('America, Heck Yeah!')); ! console.log('Setting themes is useful') // // Custom themes // ! //console.log('Generic logging theme as JSON'.green.bold.underline); // Load theme with JSON literal colors.setTheme({ silly: 'rainbow', --- 1,39 ---- var colors = require('../safe'); ! console.log(colors.yellow('First some yellow text')); ! console.log(colors.yellow.underline('Underline that text')); ! console.log(colors.red.bold('Make it bold and red')); ! console.log(colors.rainbow('Double Raindows All Day Long')); ! console.log(colors.trap('Drop the bass')); ! console.log(colors.rainbow(colors.trap('DROP THE RAINBOW BASS'))); ! // styles not widely supported ! console.log(colors.bold.italic.underline.red('Chains are also cool.')); + // styles not widely supported + console.log(colors.green('So ') + colors.underline('are') + ' ' + + colors.inverse('inverse') + colors.yellow.bold(' styles! ')); ! console.log(colors.zebra('Zebras are so fun!')); ! console.log('This is ' + colors.strikethrough('not') + ' fun.'); console.log(colors.black.bgWhite('Background color attack!')); ! console.log(colors.random('Use random styles on everything!')); console.log(colors.america('America, Heck Yeah!')); ! console.log('Setting themes is useful'); // // Custom themes // ! // console.log('Generic logging theme as JSON'.green.bold.underline); // Load theme with JSON literal colors.setTheme({ silly: 'rainbow', *************** *** 43,59 **** help: 'cyan', warn: 'yellow', debug: 'blue', ! error: 'red' }); // outputs red text ! console.log(colors.error("this is an error")); // outputs yellow text ! console.log(colors.warn("this is a warning")); // outputs grey text ! console.log(colors.input("this is an input")); // console.log('Generic logging theme as file'.green.bold.underline); --- 45,61 ---- help: 'cyan', warn: 'yellow', debug: 'blue', ! error: 'red', }); // outputs red text ! console.log(colors.error('this is an error')); // outputs yellow text ! console.log(colors.warn('this is a warning')); // outputs grey text ! console.log(colors.input('this is an input')); // console.log('Generic logging theme as file'.green.bold.underline); *************** *** 62,76 **** colors.setTheme(__dirname + '/../themes/generic-logging.js'); // outputs red text ! console.log(colors.error("this is an error")); // outputs yellow text ! console.log(colors.warn("this is a warning")); // outputs grey text ! console.log(colors.input("this is an input")); // console.log(colors.zalgo("Don't summon him")) - --- 64,77 ---- colors.setTheme(__dirname + '/../themes/generic-logging.js'); // outputs red text ! console.log(colors.error('this is an error')); // outputs yellow text ! console.log(colors.warn('this is a warning')); // outputs grey text ! console.log(colors.input('this is an input')); // console.log(colors.zalgo("Don't summon him")) Only in colors.js-1.2.4: .gitignore Only in colors.js-1.2.4: index.d.ts diff -cr -x '*.git' colors.js-1.1.2/lib/colors.js colors.js-1.2.4/lib/colors.js *** colors.js-1.1.2/lib/colors.js 2015-06-17 13:01:51.000000000 +0000 --- colors.js-1.2.4/lib/colors.js 2018-10-08 16:23:36.922055319 +0000 *************** *** 2,8 **** The MIT License (MIT) ! Original Library - Copyright (c) Marak Squires Additional functionality --- 2,8 ---- The MIT License (MIT) ! Original Library - Copyright (c) Marak Squires Additional functionality *************** *** 33,67 **** colors.themes = {}; var ansiStyles = colors.styles = require('./styles'); var defineProps = Object.defineProperties; ! colors.supportsColor = require('./system/supports-colors'); ! if (typeof colors.enabled === "undefined") { ! colors.enabled = colors.supportsColor; } ! colors.stripColors = colors.strip = function(str){ ! return ("" + str).replace(/\x1B\[\d+m/g, ''); }; ! var stylize = colors.stylize = function stylize (str, style) { if (!colors.enabled) { return str+''; } return ansiStyles[style].open + str + ansiStyles[style].close; ! } var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; ! var escapeStringRegexp = function (str) { if (typeof str !== 'string') { throw new TypeError('Expected a string'); } ! return str.replace(matchOperatorsRe, '\\$&'); ! } function build(_styles) { var builder = function builder() { --- 33,77 ---- colors.themes = {}; + var util = require('util'); var ansiStyles = colors.styles = require('./styles'); var defineProps = Object.defineProperties; + var newLineRegex = new RegExp(/[\r\n]+/g); ! colors.supportsColor = require('./system/supports-colors').supportsColor; ! if (typeof colors.enabled === 'undefined') { ! colors.enabled = colors.supportsColor() !== false; } ! colors.enable = function() { ! colors.enabled = true; }; + colors.disable = function() { + colors.enabled = false; + }; + + colors.stripColors = colors.strip = function(str) { + return ('' + str).replace(/\x1B\[\d+m/g, ''); + }; ! // eslint-disable-next-line no-unused-vars ! var stylize = colors.stylize = function stylize(str, style) { if (!colors.enabled) { return str+''; } return ansiStyles[style].open + str + ansiStyles[style].close; ! }; var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; ! var escapeStringRegexp = function(str) { if (typeof str !== 'string') { throw new TypeError('Expected a string'); } ! return str.replace(matchOperatorsRe, '\\$&'); ! }; function build(_styles) { var builder = function builder() { *************** *** 74,88 **** return builder; } ! var styles = (function () { var ret = {}; ansiStyles.grey = ansiStyles.gray; ! Object.keys(ansiStyles).forEach(function (key) { ! ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); ret[key] = { ! get: function () { return build(this._styles.concat(key)); ! } }; }); return ret; --- 84,99 ---- return builder; } ! var styles = (function() { var ret = {}; ansiStyles.grey = ansiStyles.gray; ! Object.keys(ansiStyles).forEach(function(key) { ! ansiStyles[key].closeRe = ! new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); ret[key] = { ! get: function() { return build(this._styles.concat(key)); ! }, }; }); return ret; *************** *** 91,168 **** var proto = defineProps(function colors() {}, styles); function applyStyle() { ! var args = arguments; ! var argsLen = args.length; ! var str = argsLen !== 0 && String(arguments[0]); ! if (argsLen > 1) { ! for (var a = 1; a < argsLen; a++) { ! str += ' ' + args[a]; } ! } if (!colors.enabled || !str) { return str; } var nestedStyles = this._styles; var i = nestedStyles.length; while (i--) { var code = ansiStyles[nestedStyles[i]]; str = code.open + str.replace(code.closeRe, code.open) + code.close; } return str; } ! function applyTheme (theme) { for (var style in theme) { ! (function(style){ ! colors[style] = function(str){ ! if (typeof theme[style] === 'object'){ var out = str; ! for (var i in theme[style]){ out = colors[theme[style][i]](out); } return out; } return colors[theme[style]](str); }; ! })(style) ! } ! } ! ! colors.setTheme = function (theme) { ! if (typeof theme === 'string') { ! try { ! colors.themes[theme] = require(theme); ! applyTheme(colors.themes[theme]); ! return colors.themes[theme]; ! } catch (err) { ! console.log(err); ! return err; ! } ! } else { ! applyTheme(theme); } }; function init() { var ret = {}; ! Object.keys(styles).forEach(function (name) { ret[name] = { ! get: function () { return build([name]); ! } }; }); return ret; } ! var sequencer = function sequencer (map, str) { ! var exploded = str.split(""), i = 0; exploded = exploded.map(map); ! return exploded.join(""); }; // custom formatter methods --- 102,180 ---- var proto = defineProps(function colors() {}, styles); function applyStyle() { ! var args = Array.prototype.slice.call(arguments); ! ! var str = args.map(function(arg) { ! if (arg !== undefined && arg.constructor === String) { ! return arg; ! } else { ! return util.inspect(arg); } ! }).join(' '); if (!colors.enabled || !str) { return str; } + var newLinesPresent = str.indexOf('\n') != -1; + var nestedStyles = this._styles; var i = nestedStyles.length; while (i--) { var code = ansiStyles[nestedStyles[i]]; str = code.open + str.replace(code.closeRe, code.open) + code.close; + if (newLinesPresent) { + str = str.replace(newLineRegex, code.close + '\n' + code.open); + } } return str; } ! colors.setTheme = function(theme) { ! if (typeof theme === 'string') { ! console.log('colors.setTheme now only accepts an object, not a string. ' + ! 'If you are trying to set a theme from a file, it is now your (the ' + ! 'caller\'s) responsibility to require the file. The old syntax ' + ! 'looked like colors.setTheme(__dirname + ' + ! '\'/../themes/generic-logging.js\'); The new syntax looks like '+ ! 'colors.setTheme(require(__dirname + ' + ! '\'/../themes/generic-logging.js\'));'); ! return; ! } for (var style in theme) { ! (function(style) { ! colors[style] = function(str) { ! if (typeof theme[style] === 'object') { var out = str; ! for (var i in theme[style]) { out = colors[theme[style][i]](out); } return out; } return colors[theme[style]](str); }; ! })(style); } }; function init() { var ret = {}; ! Object.keys(styles).forEach(function(name) { ret[name] = { ! get: function() { return build([name]); ! }, }; }); return ret; } ! var sequencer = function sequencer(map, str) { ! var exploded = str.split(''); exploded = exploded.map(map); ! return exploded.join(''); }; // custom formatter methods *************** *** 174,187 **** colors.maps.america = require('./maps/america'); colors.maps.zebra = require('./maps/zebra'); colors.maps.rainbow = require('./maps/rainbow'); ! colors.maps.random = require('./maps/random') for (var map in colors.maps) { ! (function(map){ ! colors[map] = function (str) { return sequencer(colors.maps[map], str); ! } ! })(map) } ! defineProps(colors, init()); \ No newline at end of file --- 186,199 ---- colors.maps.america = require('./maps/america'); colors.maps.zebra = require('./maps/zebra'); colors.maps.rainbow = require('./maps/rainbow'); ! colors.maps.random = require('./maps/random'); for (var map in colors.maps) { ! (function(map) { ! colors[map] = function(str) { return sequencer(colors.maps[map], str); ! }; ! })(map); } ! defineProps(colors, init()); diff -cr -x '*.git' colors.js-1.1.2/lib/custom/trap.js colors.js-1.2.4/lib/custom/trap.js *** colors.js-1.1.2/lib/custom/trap.js 2015-06-17 13:01:51.000000000 +0000 --- colors.js-1.2.4/lib/custom/trap.js 2018-10-08 16:23:36.922055319 +0000 *************** *** 1,45 **** ! module['exports'] = function runTheTrap (text, options) { ! var result = ""; ! text = text || "Run the trap, drop the bass"; text = text.split(''); var trap = { ! a: ["\u0040", "\u0104", "\u023a", "\u0245", "\u0394", "\u039b", "\u0414"], ! b: ["\u00df", "\u0181", "\u0243", "\u026e", "\u03b2", "\u0e3f"], ! c: ["\u00a9", "\u023b", "\u03fe"], ! d: ["\u00d0", "\u018a", "\u0500" , "\u0501" ,"\u0502", "\u0503"], ! e: ["\u00cb", "\u0115", "\u018e", "\u0258", "\u03a3", "\u03be", "\u04bc", "\u0a6c"], ! f: ["\u04fa"], ! g: ["\u0262"], ! h: ["\u0126", "\u0195", "\u04a2", "\u04ba", "\u04c7", "\u050a"], ! i: ["\u0f0f"], ! j: ["\u0134"], ! k: ["\u0138", "\u04a0", "\u04c3", "\u051e"], ! l: ["\u0139"], ! m: ["\u028d", "\u04cd", "\u04ce", "\u0520", "\u0521", "\u0d69"], ! n: ["\u00d1", "\u014b", "\u019d", "\u0376", "\u03a0", "\u048a"], ! o: ["\u00d8", "\u00f5", "\u00f8", "\u01fe", "\u0298", "\u047a", "\u05dd", "\u06dd", "\u0e4f"], ! p: ["\u01f7", "\u048e"], ! q: ["\u09cd"], ! r: ["\u00ae", "\u01a6", "\u0210", "\u024c", "\u0280", "\u042f"], ! s: ["\u00a7", "\u03de", "\u03df", "\u03e8"], ! t: ["\u0141", "\u0166", "\u0373"], ! u: ["\u01b1", "\u054d"], ! v: ["\u05d8"], ! w: ["\u0428", "\u0460", "\u047c", "\u0d70"], ! x: ["\u04b2", "\u04fe", "\u04fc", "\u04fd"], ! y: ["\u00a5", "\u04b0", "\u04cb"], ! z: ["\u01b5", "\u0240"] ! } ! text.forEach(function(c){ c = c.toLowerCase(); ! var chars = trap[c] || [" "]; var rand = Math.floor(Math.random() * chars.length); ! if (typeof trap[c] !== "undefined") { result += trap[c][rand]; } else { result += c; } }); return result; ! ! } --- 1,46 ---- ! module['exports'] = function runTheTrap(text, options) { ! var result = ''; ! text = text || 'Run the trap, drop the bass'; text = text.split(''); var trap = { ! a: ['\u0040', '\u0104', '\u023a', '\u0245', '\u0394', '\u039b', '\u0414'], ! b: ['\u00df', '\u0181', '\u0243', '\u026e', '\u03b2', '\u0e3f'], ! c: ['\u00a9', '\u023b', '\u03fe'], ! d: ['\u00d0', '\u018a', '\u0500', '\u0501', '\u0502', '\u0503'], ! e: ['\u00cb', '\u0115', '\u018e', '\u0258', '\u03a3', '\u03be', '\u04bc', ! '\u0a6c'], ! f: ['\u04fa'], ! g: ['\u0262'], ! h: ['\u0126', '\u0195', '\u04a2', '\u04ba', '\u04c7', '\u050a'], ! i: ['\u0f0f'], ! j: ['\u0134'], ! k: ['\u0138', '\u04a0', '\u04c3', '\u051e'], ! l: ['\u0139'], ! m: ['\u028d', '\u04cd', '\u04ce', '\u0520', '\u0521', '\u0d69'], ! n: ['\u00d1', '\u014b', '\u019d', '\u0376', '\u03a0', '\u048a'], ! o: ['\u00d8', '\u00f5', '\u00f8', '\u01fe', '\u0298', '\u047a', '\u05dd', ! '\u06dd', '\u0e4f'], ! p: ['\u01f7', '\u048e'], ! q: ['\u09cd'], ! r: ['\u00ae', '\u01a6', '\u0210', '\u024c', '\u0280', '\u042f'], ! s: ['\u00a7', '\u03de', '\u03df', '\u03e8'], ! t: ['\u0141', '\u0166', '\u0373'], ! u: ['\u01b1', '\u054d'], ! v: ['\u05d8'], ! w: ['\u0428', '\u0460', '\u047c', '\u0d70'], ! x: ['\u04b2', '\u04fe', '\u04fc', '\u04fd'], ! y: ['\u00a5', '\u04b0', '\u04cb'], ! z: ['\u01b5', '\u0240'], ! }; ! text.forEach(function(c) { c = c.toLowerCase(); ! var chars = trap[c] || [' ']; var rand = Math.floor(Math.random() * chars.length); ! if (typeof trap[c] !== 'undefined') { result += trap[c][rand]; } else { result += c; } }); return result; ! }; diff -cr -x '*.git' colors.js-1.1.2/lib/custom/zalgo.js colors.js-1.2.4/lib/custom/zalgo.js *** colors.js-1.1.2/lib/custom/zalgo.js 2015-06-17 13:01:51.000000000 +0000 --- colors.js-1.2.4/lib/custom/zalgo.js 2018-10-08 16:23:36.922055319 +0000 *************** *** 1,8 **** // please no module['exports'] = function zalgo(text, options) { ! text = text || " he is here "; var soul = { ! "up" : [ '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', --- 1,8 ---- // please no module['exports'] = function zalgo(text, options) { ! text = text || ' he is here '; var soul = { ! 'up': [ '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', *************** *** 15,23 **** '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', ! '??', '??' ], ! "down" : [ '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', --- 15,23 ---- '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', ! '??', '??', ], ! 'down': [ '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', *************** *** 27,74 **** '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', ! '??', '??', '??', '??' ], ! "mid" : [ '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', ! '??', '??', ' ??' ! ] ! }, ! all = [].concat(soul.up, soul.down, soul.mid), ! zalgo = {}; function randomNumber(range) { var r = Math.floor(Math.random() * range); return r; } ! function is_char(character) { var bool = false; ! all.filter(function (i) { bool = (i === character); }); return bool; } ! function heComes(text, options) { ! var result = '', counts, l; options = options || {}; ! options["up"] = typeof options["up"] !== 'undefined' ? options["up"] : true; ! options["mid"] = typeof options["mid"] !== 'undefined' ? options["mid"] : true; ! options["down"] = typeof options["down"] !== 'undefined' ? options["down"] : true; ! options["size"] = typeof options["size"] !== 'undefined' ? options["size"] : "maxi"; text = text.split(''); for (l in text) { ! if (is_char(l)) { continue; } result = result + text[l]; ! counts = {"up" : 0, "down" : 0, "mid" : 0}; switch (options.size) { case 'mini': counts.up = randomNumber(8); --- 27,79 ---- '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', ! '??', '??', '??', '??', ], ! 'mid': [ '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', ! '??', '??', ' ??', ! ], ! }; ! var all = [].concat(soul.up, soul.down, soul.mid); function randomNumber(range) { var r = Math.floor(Math.random() * range); return r; } ! function isChar(character) { var bool = false; ! all.filter(function(i) { bool = (i === character); }); return bool; } ! function heComes(text, options) { ! var result = ''; ! var counts; ! var l; options = options || {}; ! options['up'] = ! typeof options['up'] !== 'undefined' ? options['up'] : true; ! options['mid'] = ! typeof options['mid'] !== 'undefined' ? options['mid'] : true; ! options['down'] = ! typeof options['down'] !== 'undefined' ? options['down'] : true; ! options['size'] = ! typeof options['size'] !== 'undefined' ? options['size'] : 'maxi'; text = text.split(''); for (l in text) { ! if (isChar(l)) { continue; } result = result + text[l]; ! counts = {'up': 0, 'down': 0, 'mid': 0}; switch (options.size) { case 'mini': counts.up = randomNumber(8); *************** *** 87,96 **** break; } ! var arr = ["up", "mid", "down"]; for (var d in arr) { var index = arr[d]; ! for (var i = 0 ; i <= counts[index]; i++) { if (options[index]) { result = result + soul[index][randomNumber(soul[index].length)]; } --- 92,101 ---- break; } ! var arr = ['up', 'mid', 'down']; for (var d in arr) { var index = arr[d]; ! for (var i = 0; i <= counts[index]; i++) { if (options[index]) { result = result + soul[index][randomNumber(soul[index].length)]; } *************** *** 101,104 **** } // don't summon him return heComes(text, options); ! } --- 106,110 ---- } // don't summon him return heComes(text, options); ! }; ! diff -cr -x '*.git' colors.js-1.1.2/lib/extendStringPrototype.js colors.js-1.2.4/lib/extendStringPrototype.js *** colors.js-1.1.2/lib/extendStringPrototype.js 2015-06-17 13:01:51.000000000 +0000 --- colors.js-1.2.4/lib/extendStringPrototype.js 2018-10-08 16:23:36.922055319 +0000 *************** *** 1,51 **** var colors = require('./colors'); ! module['exports'] = function () { ! // // Extends prototype of native string object to allow for "foo".red syntax // ! var addProperty = function (color, func) { String.prototype.__defineGetter__(color, func); }; ! var sequencer = function sequencer (map, str) { ! return function () { ! var exploded = this.split(""), i = 0; ! exploded = exploded.map(map); ! return exploded.join(""); ! } ! }; ! ! addProperty('strip', function () { return colors.strip(this); }); ! addProperty('stripColors', function () { return colors.strip(this); }); ! addProperty("trap", function(){ return colors.trap(this); }); ! addProperty("zalgo", function(){ return colors.zalgo(this); }); ! addProperty("zebra", function(){ return colors.zebra(this); }); ! addProperty("rainbow", function(){ return colors.rainbow(this); }); ! addProperty("random", function(){ return colors.random(this); }); ! addProperty("america", function(){ return colors.america(this); }); --- 1,42 ---- var colors = require('./colors'); ! module['exports'] = function() { // // Extends prototype of native string object to allow for "foo".red syntax // ! var addProperty = function(color, func) { String.prototype.__defineGetter__(color, func); }; ! addProperty('strip', function() { return colors.strip(this); }); ! addProperty('stripColors', function() { return colors.strip(this); }); ! addProperty('trap', function() { return colors.trap(this); }); ! addProperty('zalgo', function() { return colors.zalgo(this); }); ! addProperty('zebra', function() { return colors.zebra(this); }); ! addProperty('rainbow', function() { return colors.rainbow(this); }); ! addProperty('random', function() { return colors.random(this); }); ! addProperty('america', function() { return colors.america(this); }); *************** *** 53,60 **** // Iterate through all default styles and colors // var x = Object.keys(colors.styles); ! x.forEach(function (style) { ! addProperty(style, function () { return colors.stylize(this, style); }); }); --- 44,51 ---- // Iterate through all default styles and colors // var x = Object.keys(colors.styles); ! x.forEach(function(style) { ! addProperty(style, function() { return colors.stylize(this, style); }); }); *************** *** 65,89 **** // on String that you should not overwrite. // var stringPrototypeBlacklist = [ ! '__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', 'charAt', 'constructor', ! 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf', 'charCodeAt', ! 'indexOf', 'lastIndexof', 'length', 'localeCompare', 'match', 'replace', 'search', 'slice', 'split', 'substring', ! 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight' ]; ! Object.keys(theme).forEach(function (prop) { if (stringPrototypeBlacklist.indexOf(prop) !== -1) { ! console.log('warn: '.red + ('String.prototype' + prop).magenta + ' is probably something you don\'t want to override. Ignoring style name'); ! } ! else { if (typeof(theme[prop]) === 'string') { colors[prop] = colors[theme[prop]]; ! addProperty(prop, function () { return colors[theme[prop]](this); }); ! } ! else { ! addProperty(prop, function () { var ret = this; for (var t = 0; t < theme[prop].length; t++) { ret = colors[theme[prop][t]](ret); --- 56,83 ---- // on String that you should not overwrite. // var stringPrototypeBlacklist = [ ! '__defineGetter__', '__defineSetter__', '__lookupGetter__', ! '__lookupSetter__', 'charAt', 'constructor', 'hasOwnProperty', ! 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', ! 'valueOf', 'charCodeAt', 'indexOf', 'lastIndexOf', 'length', ! 'localeCompare', 'match', 'repeat', 'replace', 'search', 'slice', ! 'split', 'substring', 'toLocaleLowerCase', 'toLocaleUpperCase', ! 'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight', ]; ! Object.keys(theme).forEach(function(prop) { if (stringPrototypeBlacklist.indexOf(prop) !== -1) { ! console.log('warn: '.red + ('String.prototype' + prop).magenta + ! ' is probably something you don\'t want to override. ' + ! 'Ignoring style name'); ! } else { if (typeof(theme[prop]) === 'string') { colors[prop] = colors[theme[prop]]; ! addProperty(prop, function() { return colors[theme[prop]](this); }); ! } else { ! addProperty(prop, function() { var ret = this; for (var t = 0; t < theme[prop].length; t++) { ret = colors[theme[prop][t]](ret); *************** *** 95,113 **** }); } ! colors.setTheme = function (theme) { if (typeof theme === 'string') { ! try { ! colors.themes[theme] = require(theme); ! applyTheme(colors.themes[theme]); ! return colors.themes[theme]; ! } catch (err) { ! console.log(err); ! return err; ! } } else { applyTheme(theme); } }; ! ! }; \ No newline at end of file --- 89,106 ---- }); } ! colors.setTheme = function(theme) { if (typeof theme === 'string') { ! console.log('colors.setTheme now only accepts an object, not a string. ' + ! 'If you are trying to set a theme from a file, it is now your (the ' + ! 'caller\'s) responsibility to require the file. The old syntax ' + ! 'looked like colors.setTheme(__dirname + ' + ! '\'/../themes/generic-logging.js\'); The new syntax looks like '+ ! 'colors.setTheme(require(__dirname + ' + ! '\'/../themes/generic-logging.js\'));'); ! return; } else { applyTheme(theme); } }; ! }; diff -cr -x '*.git' colors.js-1.1.2/lib/index.js colors.js-1.2.4/lib/index.js *** colors.js-1.1.2/lib/index.js 2015-06-17 13:01:51.000000000 +0000 --- colors.js-1.2.4/lib/index.js 2018-10-08 16:23:36.922055319 +0000 *************** *** 1,12 **** var colors = require('./colors'); module['exports'] = colors; ! // Remark: By default, colors will add style properties to String.prototype // ! // If you don't wish to extend String.prototype you can do this instead and native String will not be touched // // var colors = require('colors/safe); // colors.red("foo") // // ! require('./extendStringPrototype')(); \ No newline at end of file --- 1,13 ---- var colors = require('./colors'); module['exports'] = colors; ! // Remark: By default, colors will add style properties to String.prototype. // ! // If you don't wish to extend String.prototype, you can do this instead and ! // native String will not be touched: // // var colors = require('colors/safe); // colors.red("foo") // // ! require('./extendStringPrototype')(); diff -cr -x '*.git' colors.js-1.1.2/lib/maps/america.js colors.js-1.2.4/lib/maps/america.js *** colors.js-1.1.2/lib/maps/america.js 2015-06-17 13:01:51.000000000 +0000 --- colors.js-1.2.4/lib/maps/america.js 2018-10-08 16:23:36.922055319 +0000 *************** *** 1,12 **** var colors = require('../colors'); module['exports'] = (function() { ! return function (letter, i, exploded) { ! if(letter === " ") return letter; ! switch(i%3) { case 0: return colors.red(letter); ! case 1: return colors.white(letter) ! case 2: return colors.blue(letter) } ! } ! })(); \ No newline at end of file --- 1,12 ---- var colors = require('../colors'); module['exports'] = (function() { ! return function(letter, i, exploded) { ! if (letter === ' ') return letter; ! switch (i%3) { case 0: return colors.red(letter); ! case 1: return colors.white(letter); ! case 2: return colors.blue(letter); } ! }; ! })(); diff -cr -x '*.git' colors.js-1.1.2/lib/maps/rainbow.js colors.js-1.2.4/lib/maps/rainbow.js *** colors.js-1.1.2/lib/maps/rainbow.js 2015-06-17 13:01:51.000000000 +0000 --- colors.js-1.2.4/lib/maps/rainbow.js 2018-10-08 16:23:36.926055313 +0000 *************** *** 1,9 **** var colors = require('../colors'); ! module['exports'] = (function () { ! var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta']; //RoY G BiV ! return function (letter, i, exploded) { ! if (letter === " ") { return letter; } else { return colors[rainbowColors[i++ % rainbowColors.length]](letter); --- 1,10 ---- var colors = require('../colors'); ! module['exports'] = (function() { ! // RoY G BiV ! var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta']; ! return function(letter, i, exploded) { ! if (letter === ' ') { return letter; } else { return colors[rainbowColors[i++ % rainbowColors.length]](letter); diff -cr -x '*.git' colors.js-1.1.2/lib/maps/random.js colors.js-1.2.4/lib/maps/random.js *** colors.js-1.1.2/lib/maps/random.js 2015-06-17 13:01:51.000000000 +0000 --- colors.js-1.2.4/lib/maps/random.js 2018-10-08 16:23:36.926055313 +0000 *************** *** 1,8 **** var colors = require('../colors'); ! module['exports'] = (function () { ! var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta']; return function(letter, i, exploded) { ! return letter === " " ? letter : colors[available[Math.round(Math.random() * (available.length - 1))]](letter); }; ! })(); \ No newline at end of file --- 1,12 ---- var colors = require('../colors'); ! module['exports'] = (function() { ! var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green', ! 'blue', 'white', 'cyan', 'magenta']; return function(letter, i, exploded) { ! return letter === ' ' ? letter : ! colors[ ! available[Math.round(Math.random() * (available.length - 2))] ! ](letter); }; ! })(); diff -cr -x '*.git' colors.js-1.1.2/lib/maps/zebra.js colors.js-1.2.4/lib/maps/zebra.js *** colors.js-1.1.2/lib/maps/zebra.js 2015-06-17 13:01:51.000000000 +0000 --- colors.js-1.2.4/lib/maps/zebra.js 2018-10-08 16:23:36.926055313 +0000 *************** *** 1,5 **** var colors = require('../colors'); ! module['exports'] = function (letter, i, exploded) { return i % 2 === 0 ? letter : colors.inverse(letter); ! }; \ No newline at end of file --- 1,5 ---- var colors = require('../colors'); ! module['exports'] = function(letter, i, exploded) { return i % 2 === 0 ? letter : colors.inverse(letter); ! }; diff -cr -x '*.git' colors.js-1.1.2/lib/styles.js colors.js-1.2.4/lib/styles.js *** colors.js-1.1.2/lib/styles.js 2015-06-17 13:01:51.000000000 +0000 --- colors.js-1.2.4/lib/styles.js 2018-10-08 16:23:36.926055313 +0000 *************** *** 65,77 **** blueBG: [44, 49], magentaBG: [45, 49], cyanBG: [46, 49], ! whiteBG: [47, 49] }; ! Object.keys(codes).forEach(function (key) { var val = codes[key]; var style = styles[key] = []; style.open = '\u001b[' + val[0] + 'm'; style.close = '\u001b[' + val[1] + 'm'; ! }); \ No newline at end of file --- 65,77 ---- blueBG: [44, 49], magentaBG: [45, 49], cyanBG: [46, 49], ! whiteBG: [47, 49], }; ! Object.keys(codes).forEach(function(key) { var val = codes[key]; var style = styles[key] = []; style.open = '\u001b[' + val[0] + 'm'; style.close = '\u001b[' + val[1] + 'm'; ! }); Only in colors.js-1.2.4/lib/system: has-flag.js diff -cr -x '*.git' colors.js-1.1.2/lib/system/supports-colors.js colors.js-1.2.4/lib/system/supports-colors.js *** colors.js-1.1.2/lib/system/supports-colors.js 2015-06-17 13:01:51.000000000 +0000 --- colors.js-1.2.4/lib/system/supports-colors.js 2018-10-08 16:23:36.926055313 +0000 *************** *** 23,61 **** */ ! var argv = process.argv; ! module.exports = (function () { ! if (argv.indexOf('--no-color') !== -1 || ! argv.indexOf('--color=false') !== -1) { return false; } ! if (argv.indexOf('--color') !== -1 || ! argv.indexOf('--color=true') !== -1 || ! argv.indexOf('--color=always') !== -1) { ! return true; } ! if (process.stdout && !process.stdout.isTTY) { ! return false; } if (process.platform === 'win32') { ! return true; } ! if ('COLORTERM' in process.env) { ! return true; } ! if (process.env.TERM === 'dumb') { ! return false; } ! if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { ! return true; } ! return false; ! })(); \ No newline at end of file --- 23,151 ---- */ ! 'use strict'; ! var os = require('os'); ! var hasFlag = require('./has-flag.js'); ! ! var env = process.env; ! ! var forceColor = void 0; ! if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) { ! forceColor = false; ! } else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') ! || hasFlag('color=always')) { ! forceColor = true; ! } ! if ('FORCE_COLOR' in env) { ! forceColor = env.FORCE_COLOR.length === 0 ! || parseInt(env.FORCE_COLOR, 10) !== 0; ! } ! ! function translateLevel(level) { ! if (level === 0) { return false; } ! return { ! level: level, ! hasBasic: true, ! has256: level >= 2, ! has16m: level >= 3, ! }; ! } ! ! function supportsColor(stream) { ! if (forceColor === false) { ! return 0; } ! if (hasFlag('color=16m') || hasFlag('color=full') ! || hasFlag('color=truecolor')) { ! return 3; ! } ! ! if (hasFlag('color=256')) { ! return 2; ! } ! ! if (stream && !stream.isTTY && forceColor !== true) { ! return 0; } + var min = forceColor ? 1 : 0; + if (process.platform === 'win32') { ! // Node.js 7.5.0 is the first version of Node.js to include a patch to ! // libuv that enables 256 color output on Windows. Anything earlier and it ! // won't work. However, here we target Node.js 8 at minimum as it is an LTS ! // release, and Node.js 7 is not. Windows 10 build 10586 is the first ! // Windows release that supports 256 colors. Windows 10 build 14931 is the ! // first release that supports 16m/TrueColor. ! var osRelease = os.release().split('.'); ! if (Number(process.versions.node.split('.')[0]) >= 8 ! && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { ! return Number(osRelease[2]) >= 14931 ? 3 : 2; ! } ! ! return 1; ! } ! ! if ('CI' in env) { ! if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(function(sign) { ! return sign in env; ! }) || env.CI_NAME === 'codeship') { ! return 1; ! } ! ! return min; } ! if ('TEAMCITY_VERSION' in env) { ! return (/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0 ! ); } ! if ('TERM_PROGRAM' in env) { ! var version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); ! ! switch (env.TERM_PROGRAM) { ! case 'iTerm.app': ! return version >= 3 ? 3 : 2; ! case 'Hyper': ! return 3; ! case 'Apple_Terminal': ! return 2; ! // No default ! } ! } ! ! if (/-256(color)?$/i.test(env.TERM)) { ! return 2; } ! if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { ! return 1; } ! if ('COLORTERM' in env) { ! return 1; ! } ! ! if (env.TERM === 'dumb') { ! return min; ! } ! ! return min; ! } ! ! function getSupportLevel(stream) { ! var level = supportsColor(stream); ! return translateLevel(level); ! } ! ! module.exports = { ! supportsColor: getSupportLevel, ! stdout: getSupportLevel(process.stdout), ! stderr: getSupportLevel(process.stderr), ! }; diff -cr -x '*.git' colors.js-1.1.2/LICENSE colors.js-1.2.4/LICENSE *** colors.js-1.1.2/LICENSE 2015-06-17 13:01:51.000000000 +0000 --- colors.js-1.2.4/LICENSE 2018-10-08 16:23:36.922055319 +0000 *************** *** 1,3 **** --- 1,5 ---- + MIT License + Original Library - Copyright (c) Marak Squires *************** *** 20,23 **** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ! THE SOFTWARE. \ No newline at end of file --- 22,25 ---- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ! THE SOFTWARE. Only in colors.js-1.2.4: .npmignore diff -cr -x '*.git' colors.js-1.1.2/package.json colors.js-1.2.4/package.json *** colors.js-1.1.2/package.json 2015-06-17 13:01:51.000000000 +0000 --- colors.js-1.2.4/package.json 2018-10-08 16:23:36.926055313 +0000 *************** *** 1,28 **** { "name": "colors", "description": "get colors in your node.js console", ! "version": "1.1.2", "author": "Marak Squires", "homepage": "https://github.com/Marak/colors.js", "bugs": "https://github.com/Marak/colors.js/issues", ! "keywords": [ "ansi", "terminal", "colors" ], "repository": { "type": "git", "url": "http://github.com/Marak/colors.js.git" }, "license": "MIT", "scripts": { ! "test": "node tests/basic-test.js && node tests/safe-test.js" }, "engines": { "node": ">=0.1.90" }, ! "main": "lib", "files": [ "examples", "lib", "LICENSE", "safe.js", ! "themes" ! ] } --- 1,39 ---- { "name": "colors", "description": "get colors in your node.js console", ! "version": "1.3.0", "author": "Marak Squires", "homepage": "https://github.com/Marak/colors.js", "bugs": "https://github.com/Marak/colors.js/issues", ! "keywords": [ ! "ansi", ! "terminal", ! "colors" ! ], "repository": { "type": "git", "url": "http://github.com/Marak/colors.js.git" }, "license": "MIT", "scripts": { ! "lint": "eslint . --fix", ! "test": "node tests/basic-test.js && node tests/safe-test.js" }, "engines": { "node": ">=0.1.90" }, ! "main": "lib/index.js", "files": [ "examples", "lib", "LICENSE", "safe.js", ! "themes", ! "index.d.ts", ! "safe.d.ts" ! ], ! "devDependencies": { ! "eslint": "^4.19.1", ! "eslint-config-google": "^0.9.1" ! } } Only in colors.js-1.2.4: package-lock.json Only in colors.js-1.1.2: ReadMe.md Only in colors.js-1.2.4: README.md Only in colors.js-1.2.4: ROADMAP.md Only in colors.js-1.2.4: safe.d.ts diff -cr -x '*.git' colors.js-1.1.2/safe.js colors.js-1.2.4/safe.js *** colors.js-1.1.2/safe.js 2015-06-17 13:01:51.000000000 +0000 --- colors.js-1.2.4/safe.js 2018-10-08 16:23:36.926055313 +0000 *************** *** 1,9 **** // ! // Remark: Requiring this file will use the "safe" colors API which will not touch String.prototype // ! // var colors = require('colors/safe); // colors.red("foo") // // var colors = require('./lib/colors'); ! module['exports'] = colors; \ No newline at end of file --- 1,10 ---- // ! // Remark: Requiring this file will use the "safe" colors API, ! // which will not touch String.prototype. // ! // var colors = require('colors/safe'); // colors.red("foo") // // var colors = require('./lib/colors'); ! module['exports'] = colors; diff -cr -x '*.git' colors.js-1.1.2/tests/basic-test.js colors.js-1.2.4/tests/basic-test.js *** colors.js-1.1.2/tests/basic-test.js 2015-06-17 13:01:51.000000000 +0000 --- colors.js-1.2.4/tests/basic-test.js 2018-10-08 16:23:36.926055313 +0000 *************** *** 1,5 **** ! var assert = require('assert'), ! colors = require('../lib/index'); var s = 'string'; --- 1,5 ---- ! var assert = require('assert'); ! var colors = require('../lib/index'); var s = 'string'; *************** *** 15,26 **** assert.equal(s[color].strip, colors.strip(s)); } ! function h(s, color) { ! return '<span style="color:' + color + ';">' + s + '</span>'; ! } ! ! var stylesColors = ['white', 'black', 'blue', 'cyan', 'green', 'magenta', 'red', 'yellow']; ! var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', 'inverse', 'rainbow']); colors.mode = 'console'; assert.equal(s.bold, '\x1B[1m' + s + '\x1B[22m'); --- 15,25 ---- assert.equal(s[color].strip, colors.strip(s)); } ! var stylesColors = ['white', 'black', 'blue', 'cyan', 'green', 'magenta', ! 'red', 'yellow']; ! // eslint-disable-next-line ! var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', ! 'inverse', 'rainbow']); colors.mode = 'console'; assert.equal(s.bold, '\x1B[1m' + s + '\x1B[22m'); *************** *** 43,50 **** assert.equal(s, 'string'); ! colors.setTheme({error:'red'}); ! assert.equal(typeof("astring".red),'string'); ! assert.equal(typeof("astring".error),'string'); --- 42,63 ---- assert.equal(s, 'string'); ! var testStringWithNewLines = s + '\n' + s; ! ! // single style ! assert.equal(testStringWithNewLines.red, '\x1b[31m' + s + '\n' + s + ! '\x1b[39m'); ! ! var testStringWithNewLinesStyled = s.underline + '\n' + s.bold; ! // nested styles ! assert.equal(testStringWithNewLinesStyled.red, ! '\x1b[31m' + '\x1b[4m' + s + '\x1b[24m' + '\n' + '\x1b[1m' + s + ! '\x1b[22m' + '\x1b[39m'); + colors.setTheme({error: 'red'}); + + assert.equal(typeof ('astring'.red), 'string'); + assert.equal(typeof ('astring'.error), 'string'); + + assert.equal(s, 'string'); diff -cr -x '*.git' colors.js-1.1.2/tests/safe-test.js colors.js-1.2.4/tests/safe-test.js *** colors.js-1.1.2/tests/safe-test.js 2015-06-17 13:01:51.000000000 +0000 --- colors.js-1.2.4/tests/safe-test.js 2018-10-08 16:23:36.926055313 +0000 *************** *** 1,5 **** ! var assert = require('assert'), ! colors = require('../safe'); var s = 'string'; --- 1,5 ---- ! var assert = require('assert'); ! var colors = require('../safe'); var s = 'string'; *************** *** 12,23 **** assert.equal(colors.strip(s), s); } ! function h(s, color) { ! return '<span style="color:' + color + ';">' + s + '</span>'; ! } ! ! var stylesColors = ['white', 'black', 'blue', 'cyan', 'green', 'magenta', 'red', 'yellow']; ! var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', 'inverse', 'rainbow']); colors.mode = 'console'; assert.equal(colors.bold(s), '\x1B[1m' + s + '\x1B[22m'); --- 12,22 ---- assert.equal(colors.strip(s), s); } ! var stylesColors = ['white', 'black', 'blue', 'cyan', 'green', 'magenta', ! 'red', 'yellow']; ! // eslint-disable-next-line ! var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', 'inverse', ! 'rainbow']); colors.mode = 'console'; assert.equal(colors.bold(s), '\x1B[1m' + s + '\x1B[22m'); *************** *** 39,45 **** aE(s, 'yellow', 33); assert.equal(s, 'string'); - colors.setTheme({error:'red'}); ! assert.equal(typeof(colors.red("astring")), 'string'); ! assert.equal(typeof(colors.error("astring")), 'string'); \ No newline at end of file --- 38,59 ---- aE(s, 'yellow', 33); assert.equal(s, 'string'); ! var testStringWithNewLines = s + '\n' + s; ! ! // single style ! assert.equal(colors.red(testStringWithNewLines), ! '\x1b[31m' + s + '\x1b[39m' + '\n' + '\x1b[31m' + s + '\x1b[39m'); ! ! var testStringWithNewLinesStyled = colors.underline(s) + '\n' + colors.bold(s); ! ! // nested styles ! assert.equal(colors.red(testStringWithNewLinesStyled), ! '\x1b[31m' + '\x1b[4m' + s + '\x1b[24m' + '\x1b[39m' + '\n' + '\x1b[31m' + ! '\x1b[1m' + s + '\x1b[22m' + '\x1b[39m'); ! ! colors.setTheme({error: 'red'}); ! ! assert.equal(typeof (colors.red('astring')), 'string'); ! assert.equal(typeof (colors.error('astring')), 'string'); ! diff -cr -x '*.git' colors.js-1.1.2/themes/generic-logging.js colors.js-1.2.4/themes/generic-logging.js *** colors.js-1.1.2/themes/generic-logging.js 2015-06-17 13:01:51.000000000 +0000 --- colors.js-1.2.4/themes/generic-logging.js 2018-10-08 16:23:36.926055313 +0000 *************** *** 8,12 **** help: 'cyan', warn: 'yellow', debug: 'blue', ! error: 'red' ! }; \ No newline at end of file --- 8,12 ---- help: 'cyan', warn: 'yellow', debug: 'blue', ! error: 'red', ! }; diff -cr -x '*.git' colors.js-1.1.2/.travis.yml colors.js-1.2.4/.travis.yml *** colors.js-1.1.2/.travis.yml 2015-06-17 13:01:51.000000000 +0000 --- colors.js-1.2.4/.travis.yml 2018-10-08 16:23:36.922055319 +0000 *************** *** 1,6 **** language: node_js node_js: - "0.11" - "0.10" - "0.8" ! - "0.6" \ No newline at end of file --- 1,16 ---- language: node_js node_js: + - "10" + - "9" + - "8" + - "7" + - "6" + - "5" + - "4" + - "0.12" - "0.11" - "0.10" - "0.8" ! script: ! - npm install ! - npm test