Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 1.17 KB

README.md

File metadata and controls

45 lines (34 loc) · 1.17 KB

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            |