# orden

> Parse a markdown table string into an array of objects. With types!

Latest version **0.1.1** (published 2026-10-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install orden
pnpm add orden
yarn add orden
bun add orden
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2026-10-24 |
| First published | 2019-06-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Francisco Presencia |
| Maintainers | franciscop |
| Keywords | table, markdown, types, parse, convert, mock |

## Links

- npm: https://www.npmjs.com/package/orden
- Repository: https://github.com/franciscop/orden
- Homepage: https://github.com/franciscop/orden#readme
- Issues: https://github.com/franciscop/orden/issues
- Funding: https://www.paypal.me/franciscopresencia/19
- npm.io page: https://npm.io/package/orden

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) ^4.18.1
- [mdtable2json](https://npm.io/package/mdtable2json.md) ^0.1.0

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2026-10-24
- 0.1.0 — 2019-06-04

## README

# Orden [![npm install orden](https://img.shields.io/badge/npm%20install-orden-blue.svg)](https://www.npmjs.com/package/orden) [![tests](https://github.com/franciscop/orden/workflows/tests/badge.svg)](https://github.com/franciscop/orden/actions) [![gzip size](https://img.badgesize.io/franciscop/orden/master/index.js.svg?label=gzip&logo=&compression=gzip)](https://github.com/franciscop/orden/blob/master/index.js)

Parse a markdown table into an array of objects (with optional types). Perfect for mocking data:

```js
import table from 'orden';

const data = table(`
  |name       |age:number  |active:boolean  |
  |-----------|------------|----------------|
  |Francisco  |25          |true            |
  |Maria      |20          |false           |
`);

console.log(data);
// [
//   { name: "Francisco", age: 25, active: true },
//   { name: "Maria", age: 20, active: false },
// ]
```

## Types

- `:s`, `:string`: the default String type.
- `:n`, `:number`: parse as a Javascript number
- `:b`, `:boolean`: parse as true/false. MUST be `true` to parse as true.
- `:o`, `:object`: parse a JSON string to an object. Make sure the data is **a valid JSON Object**. Does not work with arrays or other JSON types.


```js
import table from 'orden';

const data = table(`
  |id:n |name      |location:object                  |
  |-----|----------|---------------------------------|
  |123  |Francisco |{"city":"London","country":"UK"} |
`);

console.log(data);
// [{ id: 123, name: "Francisco", location: { city: 'London', country: 'UK' } }]
```


## Define types

To define types use the second parameter:

```js
import table from 'orden';

const date = str => new Date(str);

const all = table(`
  |a:date     |b:d        |
  |-----------|-----------|
  |2019-01-01 |2019-01-01 |
`, { date, d: date });
```

If you want to define global types, you can do so with the key `types` (these are global, use with caution and only in user-code):

```js
import { types } from 'orden';
types.date = str => new Date(str);
types.d = types.d;
```

---
_Source: https://npm.io/package/orden · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
