Socket
Socket
Sign inDemoInstall

table

Package Overview
Dependencies
17
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.6.0 to 3.6.1

2

package.json
{
"name": "table",
"version": "3.6.0",
"version": "3.6.1",
"description": "Formats data into a string table.",

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

@@ -16,2 +16,3 @@ <h1 id="table">Table</h1>

* [Predefined Border Templates](#table-usage-predefined-border-templates)
* [Streaming](#table-usage-streaming)
* [Text Truncation](#table-usage-text-truncation)

@@ -455,2 +456,33 @@ * [Text Wrapping](#table-usage-text-wrapping)

<h3 id="table-usage-streaming">Streaming</h3>
`table` package exports `createStream` function used to draw a table and append rows.
`createStream` requires `{number} columnDefault.width` and `{number} columnCount` configuration properties.
```js
import {
createStream
} from 'table';
let config,
stream;
config = {
columnDefault: {
width: 50
},
columnCount: 1
};
stream = createStream(config);
setInterval(() => {
stream.write([new Date()]);
}, 500);
```
![Streaming current date.](./.README/streaming.gif)
`table` package uses ANSI escape codes to overwrite the output of the last line when a new row is printed. The underlying logic is explained in this [Stack Overflow answer](http://stackoverflow.com/a/32938658/368691).
<h3 id="table-usage-text-truncation">Text Truncation</h3>

@@ -457,0 +489,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc