在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):wooorm/markdown-table开源软件地址(OpenSource Url):https://github.com/wooorm/markdown-table开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):markdown-tableGenerate a markdown (GFM) table. Contents
What is this?This is a simple package that takes table data and generates a GitHub flavored markdown (GFM) table. When should I use this?You can use this package when you want to generate the source code of a GFM table from some data. This is a simple solution in that it doesn’t handle escapes or HTML or any of
that.
For a complete but heavier solution, build an AST and serialize it with
InstallThis package is ESM only. In Node.js (version 12.20+, 14.14+, or 16.0+), install with npm: npm install markdown-table In Deno with import {markdownTable} from 'https://esm.sh/markdown-table@3' In browsers with <script type="module">
import {markdownTable} from 'https://esm.sh/markdown-table@3?bundle'
</script> UseTypical usage (defaults to align left): import {markdownTable} from 'markdown-table'
markdownTable([
['Branch', 'Commit'],
['main', '0123456789abcdef'],
['staging', 'fedcba9876543210']
]) Yields: | Branch | Commit |
| ------- | ---------------- |
| main | 0123456789abcdef |
| staging | fedcba9876543210 | With align: markdownTable(
[
['Beep', 'No.', 'Boop'],
['beep', '1024', 'xyz'],
['boop', '3388450', 'tuv'],
['foo', '10106', 'qrstuv'],
['bar', '45', 'lmno']
],
{align: ['l', 'c', 'r']}
) Yields: | Beep | No. | Boop |
| :--- | :-----: | -----: |
| beep | 1024 | xyz |
| boop | 3388450 | tuv |
| foo | 10106 | qrstuv |
| bar | 45 | lmno | APIThis package exports the following identifiers:
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论