Comparing version 0.1.2 to 0.1.3
{ | ||
"name": "wodge", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "a wodge of functional dough", | ||
@@ -5,0 +5,0 @@ "main": "wodge.js", |
33
wodge.js
"use strict"; | ||
var l = console.log; | ||
exports.extend = function(obj, srcObj){ | ||
@@ -15,2 +17,15 @@ for (var prop in srcObj){ | ||
var ansi = { | ||
black: 30, | ||
red: 31, | ||
green: 32, | ||
yellow: 33, | ||
blue: 34, | ||
magenta: 35, | ||
cyan: 36, | ||
white: 37, | ||
bold: 1, | ||
underline: 4 | ||
}; | ||
exports.black = function(txt){ | ||
@@ -43,2 +58,8 @@ return "\x1b[30m" + txt + "\x1b[0m"; | ||
}; | ||
exports.ansi = function(){ | ||
var args = exports.array(arguments), | ||
txt = args.shift(), | ||
codes = args.map(function(arg){ return ansi[arg]; }); | ||
return "\x1b[" + codes.join(";") + "m" + txt + "\x1b[0m"; | ||
}; | ||
@@ -85,1 +106,13 @@ exports.pluck = function(object, fn){ | ||
}; | ||
if (process.platform === "win32") { | ||
exports.symbol = { | ||
tick: "\u221A", | ||
cross: "\u00D7" | ||
}; | ||
} else { | ||
exports.symbol = { | ||
tick: "✔︎", | ||
cross: "✖" | ||
}; | ||
} |
3105
104