Skip to content

adam-rocska/markdown-table-typescript

Repository files navigation

Markdown Table for TypeScript

npm version License

A library with a simple API for generating Markdown tables.

Installation

pnpm add @adam-rocska/markdown-table
npm install @adam-rocska/markdown-table
yarn add @adam-rocska/markdown-table

Usage

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:

| First Name | Last Name | Most Loved Technology |
| ---------- | --------- | --------------------- |
| Adam       | Rocska    | Swift                 |
| John       | Doe       | TypeScript            |
| Jane       | Doe       | Python                |
| Elon       | Musk      | JavaScript            |