Skip to content

Commit 7a5068d

Browse files
committed
docs(readme): update readme
1 parent a827fe6 commit 7a5068d

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

README.md

+18-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- Command-line interface (CLI) tool for easy conversion
88
- Multiple knobs available for customizing the conversion process. Don't need to minify? No problem! Prefer Array of Structures (AoS) over Structure of Arrays (SoA)? We got you covered!
99

10-
## Installation (CLI and Library)
10+
## Installation (CLI)
1111
```bash
1212
npm install -g mdt2json
1313
```
@@ -27,6 +27,14 @@ Options:
2727
```
2828

2929
## Library Usage
30+
31+
### Installation
32+
```
33+
npm install mdt2json
34+
npm install -D @types/unist # Required for TypeScript
35+
```
36+
37+
### TypeScript Usage
3038
```typescript
3139
import { MarkdownTable2Json, JsonLayout } from 'mdt2json';
3240

@@ -35,6 +43,15 @@ const transpiler = new MarkdownTable2Json({markdownString, layout: JsonLayout.Ao
3543
console.log(transpiler.transform());
3644
```
3745

46+
### JavaScript Usage
47+
```javascript
48+
const { MarkdownTable2Json, JsonLayout } = require('mdt2json');
49+
50+
const markdownString = `your_markdown_string_here`;
51+
const transpiler = new MarkdownTable2Json({markdownString, layout: JsonLayout.AoS , minify: true });
52+
console.log(transpiler.transform());
53+
```
54+
3855
## Use Cases
3956
- Converting markdown tables to JSON for use in your web application
4057
- Improve token efficiency of your markdown files for use in retrieval augmented generation (RAG) architecture with LLMs (Large Language Models) such as GPT-3

0 commit comments

Comments
 (0)