1.0.12 • Published 4 years ago

@fmma-npm/sort-markdown-tables v1.0.12

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

Sort a markdown table by the first column.

Install

npm install -g @fmma-npm/sort-markdown-tables

Example

Add <!-- sort-table --> in the markdown (Readme.md) file above the table:

<!-- sort-table -->
| Unsorted | Table            |
| -------- | ---------------- |
| xxx      | should be third  |
| aaa      | should be first  |
| bbb      | should be second |
| yyy      | should be forth  |

Run the command:

$ sort-markdown-tables Readme.md

The output is

<!-- sort-table -->
| Unsorted | Table            |
| -------- | ---------------- |
| aaa      | should be first  |
| bbb      | should be second |
| xxx      | should be third  |
| yyy      | should be forth  |

Make the change inplace with the -i flag:

$ sort-markdown-tables -i Readme.md

You can also sort all tables (with or without the <!-- sort-table --> tag) using the -a flag:

$ sort-markdown-tables -i -a Readme.md
1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.12

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago