Socket
Socket
Sign inDemoInstall

table

Package Overview
Dependencies
11
Maintainers
2
Versions
86
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.5 to 1.0.0

.babelrc

54

package.json
{
"name": "table",
"description": "Node Tables",
"version": "0.0.5",
"author": "Jan Gorman <gorman.jan@gmail.com>",
"keywords": ["table", "cli", "text"],
"dependencies": { "vows": ">=0.5.3"},
"repository" : {"type": "git" , "url": "https://github.com/JanGorman/node-table" },
"directories": {
"lib": "./lib"
"version": "1.0.0",
"description": "Formats data into a string table.",
"main": "./dist/index.js",
"author": {
"name": "Gajus Kuizinas",
"email": "gk@anuary.com",
"url": "http://gajus.com"
},
"engines": { "node": ">= 0.2.0" }
"repository": {
"type": "git",
"url": "https://github.com/gajus/table"
},
"keywords": [
"ascii",
"text",
"table"
],
"scripts": {
"test": "babel-node ./node_modules/.bin/gulp lint",
"build": "babel-node ./node_modules/.bin/gulp build",
"watch": "babel-node ./node_modules/.bin/gulp watch"
},
"devDependencies": {
"babel-core": "^5.8.24",
"babel-loader": "^5.3.2",
"babel-plugin-lodash": "^0.2.0",
"canonical": "^1.0.1",
"chai": "^3.2.0",
"chalk": "^1.1.1",
"del": "^2.0.2",
"globby": "^3.0.1",
"gulp": "^3.9.0",
"gulp-babel": "^5.2.1",
"gulp-mocha": "^2.1.3",
"gulp-sourcemaps": "^1.5.2",
"gulp-util": "^3.0.6"
},
"dependencies": {
"ansi-slice": "^1.0.3",
"bluebird": "^2.10.0",
"lodash": "^3.10.1",
"string-length": "^1.0.1",
"string-width": "^1.0.1",
"strip-ansi": "^3.0.0",
"xregexp": "slevithan/xregexp#baef6b6429fbd6f9aeb3c2c86a41b5422b023e18"
}
}

59

README.md

@@ -1,47 +0,32 @@

## About
# Table
table is a component to create text based tables. This might be useful for text emails or to display tables in the CLI.
[![NPM version](http://img.shields.io/npm/v/table.svg?style=flat)](https://www.npmjs.com/package/table)
[![js-canonical-style](https://img.shields.io/badge/code%20style-canonical-brightgreen.svg?style=flat)](https://github.com/gajus/canonical)
## Install
(This library is work in progress. The working library will be released in 2.0.0.)
npm install table
Formats data into a string table.
## Example
* Works with strings containing [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) characters.
* Works with strings containing [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code).
* Supports `minWidth`, `maxWidth` properties per column.
* Supports expanding long cell values into multiple rows.
var sys = require('sys'), Table = require('table');
## Usage
var table = new Table( [15, 20] );
table
.setDefaultColumnAlignment(['left', 'center'])
.appendRow(['Node', 'Table'])
.appendRow(['Second', 'Row'])
.appendRow(['Third', 'Row'])
.appendRow(["Fourth\nsecond line", 'Row']);
sys.puts(table.render());
will result in a nice looking table:
### Basic Table
+---------------+--------------------+
|Node | Table |
|---------------+--------------------|
|Second | Row |
|---------------+--------------------|
|Third | Row |
|---------------+--------------------|
|Fourth | Row |
|second line | |
+---------------+--------------------+
Valid alignments are 'left', 'center' and 'right'.
Table data is described using an array of arrays.
## Build
```js
let table = require('table'),
data;
To build the project call
data = [
['0A', '0B', '0C'],
['1A', '1B', '1C'],
['2A', '2B', '2C']
];
cake build
## Test
To run the test simply call
cake test
console.log(table(data));
```
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc