word-table
word-table is a simple javascript (browserjs / nodejs) library for drawing ascii tables in the
terminal
/console
. Based on word-width.
1. Install & Import
npm install word-table
- Import it with
script
tag in HTML.
<script type="text/javascript" src="dist/word-table.min.js"></script>
- Import it with
require
.
var WordTable = ;//or;
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 usagevar wt = header body;console;
The API is so simple that documents are not needed.
wt;wt;wt;wt;wt;wt;
Detail usage and demo code, can see here, and run npm test
can see the output.
The api are all chainable method, e.g.
var wt = ;wt ;var str = wt;
3. Test
npm install
npm run build
npm test
Or you can open the website, then test it in Console [F12]
.
4. LICENSE
MIT@hustcc.