Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adam-rocska/markdown-table-typescript
A small TypeScript library with a convenient API to produce tables in MarkDown.
https://github.com/adam-rocska/markdown-table-typescript
api convenient-api es6 generator javascript js library markdown markdown-table markdown-tables modules nodejs npm package table tools ts typescript utility
Last synced: 1 day ago
JSON representation
A small TypeScript library with a convenient API to produce tables in MarkDown.
- Host: GitHub
- URL: https://github.com/adam-rocska/markdown-table-typescript
- Owner: adam-rocska
- License: mit
- Created: 2024-08-09T15:11:23.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2024-08-29T15:22:58.000Z (5 months ago)
- Last Synced: 2025-01-13T01:09:01.468Z (2 days ago)
- Topics: api, convenient-api, es6, generator, javascript, js, library, markdown, markdown-table, markdown-tables, modules, nodejs, npm, package, table, tools, ts, typescript, utility
- Language: TypeScript
- Homepage:
- Size: 182 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Markdown Table for TypeScript
[![npm version](https://img.shields.io/npm/v/@adam-rocska/markdown-table)](https://www.npmjs.com/package/@adam-rocska/markdown-table)
[![License](https://img.shields.io/npm/l/@adam-rocska/markdown-table)](https://github.com/adam-rocska/markdown-table-typescript/blob/main/LICENSE)A library with a simple API for generating Markdown tables.
## Installation
```zsh
pnpm add @adam-rocska/markdown-table
``````zsh
npm install @adam-rocska/markdown-table
``````zsh
yarn add @adam-rocska/markdown-table
```## Usage
```typescript
import {markdownTable} from '@adam-rocska/markdown-table';markdownTable(
['First Name', 'Last Name', 'Most Loved Technology'],
['Adam', 'Rocska', 'Swift'],
['John', 'Doe', 'TypeScript'],
['Jane', 'Doe', 'Python'],
['Elon', 'Musk', 'JavaScript']
);
```The code above yields the following output:
```md
| First Name | Last Name | Most Loved Technology |
| ---------- | --------- | --------------------- |
| Adam | Rocska | Swift |
| John | Doe | TypeScript |
| Jane | Doe | Python |
| Elon | Musk | JavaScript |
```