Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tty-table

Package Overview
Dependencies
Maintainers
1
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tty-table - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

5

docs/automattic-cli-table.md

@@ -60,1 +60,6 @@ # Automattic/cli-table Adapter

```
- Outputs:
![Automattic/cli-table Example Output](https://cloud.githubusercontent.com/assets/7478359/15693270/c901a0ce-2748-11e6-8fcb-e946b6c608f1.png "Automattic/cli-table Output Example")

4

docs/terminal.md

@@ -1,2 +0,2 @@

# Using tty-table as a Command Line Application:
# Using tty-table as a terminal application:

@@ -6,3 +6,3 @@ ## Installation

```
$ sudo apt-get install nodejs //if not already installed
$ sudo apt-get install nodejs
$ npm install tty-table -g

@@ -9,0 +9,0 @@ ```

{
"name": "tty-table",
"version": "2.0.1",
"version": "2.0.2",
"description": "Command line table generator.",

@@ -5,0 +5,0 @@ "main": "src/main.js",

@@ -9,3 +9,3 @@ # tty-table

- As a terminal application:
- As a [terminal application](docs/terminal.md):

@@ -42,2 +42,4 @@ ```

- See the [docs here](docs/automattic-cli-table.md).
### Beyond that, the native API also supports:

@@ -48,3 +50,3 @@

- Padding
- Pass rows as either arrays or objects
- Passing of rows as either arrays or objects
- Colors (not supported in browser)

@@ -57,3 +59,8 @@ - [Footer](https://github.com/tecfu/tty-table/issues/6)

### Terminal
### Terminal Application
(npm i -g tty-table)
![Terminal Application Example](https://cloud.githubusercontent.com/assets/7478359/15691533/39f5fed4-273e-11e6-81a6-533bd8dbd1c4.gif "Terminal Application Example")
### Nodejs Module
![Terminal Example](https://cloud.githubusercontent.com/assets/7478359/15691679/07142030-273f-11e6-8f1e-25728d558a2d.png "Terminal Example")

@@ -64,3 +71,3 @@

[Working example](https://cdn.rawgit.com/tecfu/tty-table/master/examples/browser-example.html)
[Working Example in Browser](https://cdn.rawgit.com/tecfu/tty-table/master/examples/browser-example.html)

@@ -268,3 +275,6 @@ > Note that neither ASCI colors nor default borders are rendered in the browser.

| options.borderCharacters | <code>array</code> | [See @note](#note) |
| options.borderColor | <code>array</code> | default: terminal's default color |
| options.borderColor | <code>string</code> | default: terminal's default color |
| options.defaultErrorValue | <code>mixed</code> | default: 'ERROR!' |
| options.defaultValue | <code>mixed</code> | default: '?' |
| options.errorOnNull | <code>boolean</code> | default: false |

@@ -271,0 +281,0 @@ **Example**

@@ -24,3 +24,5 @@ var Config = {

compact : false,
defaultErrorValue : " ERROR! ",
defaultValue : " ? ",
errorOnNull : false,
footerAlign : "center",

@@ -27,0 +29,0 @@ footerColor : false,

@@ -37,3 +37,6 @@ var Merge = require("merge");

* @param {array} options.borderCharacters - [See @note](#note)
* @param {array} options.borderColor - default: terminal's default color
* @param {string} options.borderColor - default: terminal's default color
* @param {mixed} options.defaultErrorValue - default: 'ERROR!'
* @param {mixed} options.defaultValue - default: '?'
* @param {boolean} options.errorOnNull - default: false

@@ -40,0 +43,0 @@ * @returns {Table}

@@ -151,5 +151,10 @@ var Merge = require("merge");

//get row as array of cell arrays
var cArrs = row.map(function(cell,index){
//can't use es5 row functions (map, forEach because of
//potential ellision; by which [1,,3] will only iterate 1,3
var cArrs = [];
var rowLength = row.length;
for(var index=0; index<rowLength; index++){
var c = Render.buildCell(config,cell,index,rowType);
var c = Render.buildCell(config,row[index],index,rowType);
var cellArr = c.cellArr;

@@ -164,4 +169,4 @@

return cellArr;
});
cArrs.push(cellArr);
}

@@ -215,3 +220,3 @@ //adjust minRowHeight to reflect vertical row padding

//replace undefined/null cell values with placeholder
cellValue = config.defaultValue;
cellValue = (config.errorOnNull) ? config.defaultErrorValue : config.defaultValue;
break;

@@ -218,0 +223,0 @@ case(typeof cell === 'object' && typeof cell.value !== 'undefined'):

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc