Comparing version 0.0.2 to 0.0.3
@@ -6,10 +6,10 @@ #!/usr/bin/env node | ||
var table = asciitable([ | ||
{a: "a", b: "b", c: "c"}, | ||
{a: "asddsfa", b: "sss", c: "zxc"}, | ||
{a: "dsgvdgsdvgssdf", b: "x", c: "eryty"}, | ||
{a: "m", b: "n", c: "o", d: "p"}, | ||
{a: 5, b: null, c: {}, d: []}, | ||
{a: function(){}}, | ||
{ab: "a", b: "b", c: "c"}, | ||
{ab: "asddsfa", b: "sss", c: "zxc"}, | ||
{ab: "dsgvdgsdvgssdf", b: "x", c: "eryty"}, | ||
{ab: "m", b: "n", c: "o", de: "p"}, | ||
{ab: 5, b: null, c: {}, de: []}, | ||
{ab: function(){}}, | ||
]); | ||
console.log(table); |
var asciitable = module.exports = function asciitable(options, data) { | ||
var pad = function pad(text, length) { | ||
if (typeof text === "undefined") { text = ""; } | ||
return ("" + text) + (new Array((length - ("" + text).length) + 1)).join(" "); | ||
return ("" + text) + new Array(Math.max((length - ("" + text).length) + 1,0)).join(" "); | ||
}; | ||
@@ -30,3 +30,3 @@ | ||
field: e, | ||
width: 0, | ||
width: e.length, | ||
}; | ||
@@ -33,0 +33,0 @@ }); |
{ | ||
"name": "asciitable", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Render tables in text for tabular terminal fun times!", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
6519