All Projects → hustcc → word-table

hustcc / word-table

Licence: MIT license
◼️ a simple javascript (browserjs / nodejs) library for drawing tables in the terminal / console, unicode supported.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to word-table

table2ascii
Python library for converting lists to fancy ASCII tables for displaying in the terminal and on Discord
Stars: ✭ 31 (-45.61%)
Mutual labels:  ascii
asciichart
ASCII line charts in terminal ╭┈╯ Haskell port of kroitor/asciichart
Stars: ✭ 23 (-59.65%)
Mutual labels:  ascii
why-roguelike
A multiplayer ASCII roguelike
Stars: ✭ 17 (-70.18%)
Mutual labels:  ascii
characteristics
Character info under different encodings
Stars: ✭ 25 (-56.14%)
Mutual labels:  ascii
ascii-art
Given a image.bmp and a M x N group of pixels, generate a text that represents the image.bmp in ascii characters
Stars: ✭ 16 (-71.93%)
Mutual labels:  ascii
battery
Draw battery unicode art written by Go
Stars: ✭ 66 (+15.79%)
Mutual labels:  ascii
diagwiz
Diagrams as code
Stars: ✭ 41 (-28.07%)
Mutual labels:  ascii
durdraw
Animated Unicode, ANSI and ASCII Art Editor for Linux/Unix/macOS
Stars: ✭ 55 (-3.51%)
Mutual labels:  ascii
Axes-Armour-Ale
A fantasy, ASCII dungeon crawler for Windows, Linux & OSX
Stars: ✭ 22 (-61.4%)
Mutual labels:  ascii
ansilove-php
A set of tools to convert ANSi and artscene related file formats into PNG images
Stars: ✭ 56 (-1.75%)
Mutual labels:  ascii
jpgtxt
Generating jpg files that can be viewed both in image viewer and text editor (as ASCII art)
Stars: ✭ 24 (-57.89%)
Mutual labels:  ascii
AACircuit
Pythonized AACircuit: Draw electronic circuits with ASCII characters.
Stars: ✭ 83 (+45.61%)
Mutual labels:  ascii
AACircuit
Draw circuits using ASCII
Stars: ✭ 54 (-5.26%)
Mutual labels:  ascii
homoglyphs
Homoglyphs: get similar letters, convert to ASCII, detect possible languages and UTF-8 group.
Stars: ✭ 70 (+22.81%)
Mutual labels:  ascii
How-to-use-Readline-in-NodeJS
⌨️ How to manipulate the terminal window using NodeJS
Stars: ✭ 20 (-64.91%)
Mutual labels:  ascii
asciju
Conversion of Image, video, text into ASCII format
Stars: ✭ 11 (-80.7%)
Mutual labels:  ascii
p8-programming-fonts
A collection of fonts I've modified for PICO-8 programming.
Stars: ✭ 67 (+17.54%)
Mutual labels:  ascii
DreamForgerJS
Interactive Fiction JS library
Stars: ✭ 14 (-75.44%)
Mutual labels:  ascii
attic
A collection of personal tiny tools - mirror of https://gitlab.com/hydrargyrum/attic
Stars: ✭ 17 (-70.18%)
Mutual labels:  ascii
memcache
Node.js memcached client with the most efficient ASCII protocol parser
Stars: ✭ 26 (-54.39%)
Mutual labels:  ascii

word-table

word-table is a simple javascript (browserjs / nodejs) library for drawing ascii tables in the terminal / console. Based on word-width.

Build Status Coverage Status npm npm npm

screenshot

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 = require('word-table');
//or
import WordTable from 'word-table';

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());

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.

The api are all chainable method, e.g.

var wt = new WordTable();
wt.reset()
  .setHeader(['id', 'name', 'birthday'])
  .appendBody(['#3', '佚名', '保密']);
var str = wt.string();

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].