{"id":16231503,"url":"https://github.com/hustcc/word-table","last_synced_at":"2025-03-16T12:32:11.218Z","repository":{"id":57399006,"uuid":"70883812","full_name":"hustcc/word-table","owner":"hustcc","description":":black_medium_square: a simple javascript (browserjs / nodejs) library for drawing tables in the terminal / console, unicode supported.","archived":false,"fork":false,"pushed_at":"2017-06-19T01:17:43.000Z","size":29,"stargazers_count":59,"open_issues_count":4,"forks_count":14,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-17T16:04:03.358Z","etag":null,"topics":["ascii","ascii-table","draw-table","javascript","nodejs","word-table"],"latest_commit_sha":null,"homepage":"http://git.hust.cc/word-table","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hustcc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-14T07:10:45.000Z","updated_at":"2024-03-08T06:11:41.000Z","dependencies_parsed_at":"2022-09-13T21:21:14.223Z","dependency_job_id":null,"html_url":"https://github.com/hustcc/word-table","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Fword-table","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Fword-table/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Fword-table/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Fword-table/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hustcc","download_url":"https://codeload.github.com/hustcc/word-table/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221663619,"owners_count":16859867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ascii","ascii-table","draw-table","javascript","nodejs","word-table"],"created_at":"2024-10-10T13:05:48.956Z","updated_at":"2024-10-27T10:33:50.691Z","avatar_url":"https://github.com/hustcc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# word-table\n\n\u003e **word-table** is a simple javascript (browserjs / nodejs) library for drawing ascii tables in the `terminal` / `console`. Based on [word-width](https://github.com/hustcc/word-width).\n\n\n[![Build Status](https://travis-ci.org/hustcc/word-table.svg?branch=master)](https://travis-ci.org/hustcc/word-table) [![Coverage Status](https://coveralls.io/repos/github/hustcc/word-table/badge.svg?branch=master)](https://coveralls.io/github/hustcc/word-table?branch=master) [![npm](https://img.shields.io/npm/v/word-table.svg)](https://www.npmjs.com/package/word-table) [![npm](https://img.shields.io/npm/dt/word-table.svg)](https://www.npmjs.com/package/word-table) [![npm](https://img.shields.io/npm/l/word-table.svg)](https://www.npmjs.com/package/word-table)\n\n\n![screenshot](screenshot.png)\n\n\n# 1. Install \u0026 Import\n\n\u003e **npm install word-table**\n\n\n - Import it with `script` tag in HTML.\n\n```js\n\u003cscript type=\"text/javascript\" src=\"dist/word-table.min.js\"\u003e\u003c/script\u003e\n```\n\n - Import it with `require`.\n\n```js\nvar WordTable = require('word-table');\n//or\nimport WordTable from 'word-table';\n```\n\n\n# 2. Usage \u0026 API\n\nSee a demo firstly:\n\n```js\nvar header = ['id', 'name', 'birthday'];\nvar body = [\n  ['#1', '王小为', '1992-08-01', '备注：hustcc'], \n  ['#2', '小泥巴', '1992-09-20'],\n  ['#3', '佚名', '保密']\n];\n\n// basic usage\nvar wt = new WordTable(header, body);\nconsole.log(wt.string());\n```\n\nThe API is so simple that documents are not needed.\n\n```js\nwt.setHeader(['id', 'name', 'birthday']);\nwt.appendBody(['#3', '佚名', '保密']);\nwt.setBody([['#4', '在线工具', '保密', 'atool.org']]);\nwt.array();\nwt.string();\nwt.reset();\n```\n\nDetail usage and demo code, can see [here](tests/test.js), and run `npm test` can see the output.\n\nThe api are all chainable method, e.g.\n\n```js\nvar wt = new WordTable();\nwt.reset()\n  .setHeader(['id', 'name', 'birthday'])\n  .appendBody(['#3', '佚名', '保密']);\nvar str = wt.string();\n```\n\n\n# 3. Test\n\n\u003e npm install\n\u003e\n\u003e npm run build\n\u003e \n\u003e npm test\n\nOr you can open the [website](http://git.hust.cc/word-table/), then test it in `Console [F12]`.\n\n\n# 4. LICENSE\n\nMIT@[hustcc](https://github.com/hustcc).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhustcc%2Fword-table","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhustcc%2Fword-table","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhustcc%2Fword-table/lists"}