Comparing version 0.0.5 to 0.0.6
@@ -7,3 +7,3 @@ #!/usr/bin/env node | ||
skinny: true, | ||
plusIntersections: true, | ||
intersectionCharacter: "x", | ||
columns: [ | ||
@@ -10,0 +10,0 @@ {field: "ab", name: "First"}, |
@@ -17,2 +17,6 @@ var asciitable = module.exports = function asciitable(options, data) { | ||
if (!options.intersectionCharacter) { | ||
options.intersectionCharacter = "-"; | ||
} | ||
var columns; | ||
@@ -53,3 +57,3 @@ if (options.columns) { | ||
var separator = [""].concat(columns.map(function(e) { return (new Array(e.width + 1)).join("-"); })).concat([""]).join(options.plusIntersections ? "-+-" : "---"); | ||
var separator = [""].concat(columns.map(function(e) { return (new Array(e.width + 1)).join("-"); })).concat([""]).join("-" + options.intersectionCharacter + "-"); | ||
@@ -56,0 +60,0 @@ output.push(separator); |
{ | ||
"name": "asciitable", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Render tables in text for tabular terminal fun times!", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -53,2 +53,13 @@ asciitable | ||
console.log(table); | ||
// pretty table | ||
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"}, | ||
], { | ||
skinny: true, | ||
intersectionCharacter: "@", | ||
}); | ||
``` | ||
@@ -67,4 +78,4 @@ | ||
array. | ||
* _plusIntersections_ - enables using a `+` character at line intersections. | ||
Default is false. Or undefined. Whatever, default is "not enabled". | ||
* _intersectionCharacter_ - changes what character to use at points where lines | ||
intersect. The default is "-". | ||
* _skinny_ - trims the "hanging" characters used in the layout. Saves you two | ||
@@ -82,2 +93,4 @@ horizontal characters! | ||
var options = { | ||
skinny: true, | ||
intersectionCharacter: "x", | ||
columns: [ | ||
@@ -106,12 +119,12 @@ {field: "ab", name: "First"}, | ||
``` | ||
-------------------------------------------------------- | ||
| First | Second | Third | Fourth | | ||
-------------------------------------------------------- | ||
| a | b | c | | | ||
| asddsfa | sss | zxc | | | ||
| dsgvdgsdvgssdf | x | eryty | | | ||
| m | n | o | p | | ||
| 5 | null | [object Object] | | | ||
| function (){} | | | | | ||
-------------------------------------------------------- | ||
x----------------x--------x-----------------x--------x | ||
| First | Second | Third | Fourth | | ||
x----------------x--------x-----------------x--------x | ||
| a | b | c | | | ||
| asddsfa | sss | zxc | | | ||
| dsgvdgsdvgssdf | x | eryty | | | ||
| m | n | o | p | | ||
| 5 | null | [object Object] | | | ||
| function (){} | | | | | ||
x----------------x--------x-----------------x--------x | ||
``` | ||
@@ -118,0 +131,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
7844
80
140