Skip to content

Commit

Permalink
Updates README for CLI
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Donat <[email protected]>
  • Loading branch information
donatj committed Dec 1, 2023
1 parent 56d6411 commit d8faaeb
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,38 @@ Requires **no external libraries**. Works in Node as well as in the browser.

## Install

```
```bash
npm install csv-to-markdown-table
```

## Usage

### CLI

This package also includes a CLI tool. You can install it globally with:

```bash
npm install -g csv-to-markdown-table
```

Then you can use it like so:

```bash
$ csvtomarkdown --help
Usage: csvtomarkdown [options]
// … help output

$ csvtomarkdown --delimiter ',' --headers < example.csv
| cats | dogs | fish |
|------|------|------|
| 1 | 2 | 3 |
| 4 | 5 | 6 |
$ csvtomarkdown
Reading from stdin... (press Ctrl+D at the start of a line to finish)
CSV Delimiter: \t (tab) Headers: false
[interactive input]
```

### Raw JS via Global

```js
Expand Down Expand Up @@ -49,7 +75,7 @@ console.log(

#### Outputs:

```
```markdown
| header1 | header2 | header3 |
|---------|---------|---------|
| Value1 | Value2 | Value3 |
Expand Down

0 comments on commit d8faaeb

Please sign in to comment.