cliff
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -110,8 +110,11 @@ /* | ||
// | ||
cliff.stringifyRows = function (rows, colors) { | ||
cliff.stringifyRows = function (rows, colors, options) { | ||
var lengths, columns, output = [], headers; | ||
options = options || {}; | ||
options.columnSpacing = options.columnSpacing || 2; | ||
columns = cliff.columnMajor(rows); | ||
lengths = cliff.arrayLengths(columns); | ||
function stringifyRow(row, colorize) { | ||
@@ -121,5 +124,9 @@ var rowtext = '', padding, item, i, length; | ||
item = cliff.stringifyLiteral(row[i]); | ||
item = colorize ? item[colors[i]] : item; | ||
if(colorize) { | ||
item = item[colors[i]] || item[colors[colors.length -1]] || item; | ||
} | ||
length = realLength(item); | ||
padding = length < lengths[i] ? lengths[i] - length + 2 : 2; | ||
padding = length < lengths[i] ? lengths[i] - length + options.columnSpacing : options.columnSpacing ; | ||
rowtext += item + new Array(padding).join(' '); | ||
@@ -153,3 +160,3 @@ } | ||
// | ||
cliff.stringifyObjectRows = cliff.rowifyObjects = function (objs, properties, colors) { | ||
cliff.stringifyObjectRows = cliff.rowifyObjects = function (objs, properties, colors, options) { | ||
var rows = [properties].concat(objs.map(function (obj) { | ||
@@ -159,3 +166,3 @@ return cliff.extractFrom(obj, properties); | ||
return cliff.stringifyRows(rows, colors); | ||
return cliff.stringifyRows(rows, colors, options); | ||
}; | ||
@@ -162,0 +169,0 @@ |
{ | ||
"name": "cliff", | ||
"description": "Your CLI formatting friend.", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"author": "Nodejitsu Inc. <info@nodejitsu.com>", | ||
@@ -22,6 +22,6 @@ "repository": { | ||
"eyes": "0.1.x", | ||
"winston": "0.6.x" | ||
"winston": "0.8.x" | ||
}, | ||
"devDependencies": { | ||
"vows": "0.5.x" | ||
"vows": "0.7.x" | ||
}, | ||
@@ -28,0 +28,0 @@ "main": "./lib/cliff", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
255019
425
1
+ Addedasync@0.2.10(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedpkginfo@0.3.1(transitive)
+ Addedwinston@0.8.3(transitive)
- Removedasync@0.1.22(transitive)
- Removedpkginfo@0.2.3(transitive)
- Removedrequest@2.9.203(transitive)
- Removedwinston@0.6.2(transitive)
Updatedwinston@0.8.x