在 控制台 输出 table 表格的 Javascript 库-演道网
<a href="#word-table"></a>word-table
word-table is simple javascript library for drawing ascii tables in the terminal / console.
<图片p_2> https://camo.githubusercontent.com/00b82bbc9c7cdf819c6da1f2e7092c74a0d9c00b/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f776f72642d7461626c652e7376673f7374796c653d666c61742d737175617265 https://camo.githubusercontent.com/8cc8d39357bab424b2b9d1e934c0bd29a0ea2cc7/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f64742f776f72642d7461626c652e7376673f7374796c653d666c61742d737175617265 https://camo.githubusercontent.com/3b85e0f8b41bb18b11dc514dae18de385f307c66/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f6c2f776f72642d7461626c652e7376673f7374796c653d666c61742d737175617265
<a href="#1-install--import"></a>1. Install & Import
npm install word-table
var WorkTable = require('word-table');
//or
import WorkTable from 'word-table';
<a href="#2-usage--api"></a>2. Usage & API
See a demo firstly:
var header = ['id', 'name', 'birthday'];
var body = [
['#1', '王小为', '1992-08-01', '备注:hustcc'],
['#2', '小泥巴', '1992-09-20'],
['#3', '佚名', '保密']
];
// basic usage
var wt = new WordTable(header, body);
console.log(wt.string());
<a href="/hustcc/word-table/blob/master/screenshot.png"></a>
The API is so simple that documents are not needed.
wt.setHeader(['id', 'name', 'birthday']);
wt.appendBody(['#3', '佚名', '保密']);
wt.setBody(['#4', '在线工具', '保密', 'atool.org']);
wt.array();
wt.string();
wt.reset();
Detail usage and demo code, can see here, and run npm test can see the output.
<a href="#3-todo"></a>3. TODO
Browser Javascript supported.
<a href="#4-test"></a>4. Test
npm install
npm test
<a href="#5-license"></a>5. LICENSE
MIT
转载自演道,想查看更及时的互联网产品技术热点文章请点击http://go2live.cn
word-table is simple javascript library for drawing ascii tables in the terminal / console.
<图片p_2> https://camo.githubusercontent.com/00b82bbc9c7cdf819c6da1f2e7092c74a0d9c00b/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f776f72642d7461626c652e7376673f7374796c653d666c61742d737175617265 https://camo.githubusercontent.com/8cc8d39357bab424b2b9d1e934c0bd29a0ea2cc7/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f64742f776f72642d7461626c652e7376673f7374796c653d666c61742d737175617265 https://camo.githubusercontent.com/3b85e0f8b41bb18b11dc514dae18de385f307c66/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f6c2f776f72642d7461626c652e7376673f7374796c653d666c61742d737175617265
<a href="#1-install--import"></a>1. Install & Import
npm install word-table
var WorkTable = require('word-table');
//or
import WorkTable from 'word-table';
<a href="#2-usage--api"></a>2. Usage & API
See a demo firstly:
var header = ['id', 'name', 'birthday'];
var body = [
['#1', '王小为', '1992-08-01', '备注:hustcc'],
['#2', '小泥巴', '1992-09-20'],
['#3', '佚名', '保密']
];
// basic usage
var wt = new WordTable(header, body);
console.log(wt.string());
<a href="/hustcc/word-table/blob/master/screenshot.png"></a>
The API is so simple that documents are not needed.
wt.setHeader(['id', 'name', 'birthday']);
wt.appendBody(['#3', '佚名', '保密']);
wt.setBody(['#4', '在线工具', '保密', 'atool.org']);
wt.array();
wt.string();
wt.reset();
Detail usage and demo code, can see here, and run npm test can see the output.
<a href="#3-todo"></a>3. TODO
Browser Javascript supported.
<a href="#4-test"></a>4. Test
npm install
npm test
<a href="#5-license"></a>5. LICENSE
MIT
转载自演道,想查看更及时的互联网产品技术热点文章请点击http://go2live.cn
还没人转发这篇日记