@tabnas/markdown
v0.2.0
Published
This plugin allows the [Tabnas](https://github.com/tabnas/jsonic) JSON parser to support markdown syntax.
Maintainers
Readme
@tabnas/markdown (TypeScript)
A Tabnas grammar plugin that parses delimited record text — a header row, comma-separated fields, one record per line, with RFC-4180 quoting — into arrays of objects or arrays. Despite the name it is a configurable CSV/TSV-family reader, with support for headers, quoted fields, custom delimiters, streaming, and strict / non-strict modes.
|
| This open source module is sponsored and supported by Voxgig. |
| ---------------------------------------------------- | --------------------------------------------------------------------------------------- |
Install
npm install @tabnas/markdown @tabnas/parser @tabnas/jsonic@tabnas/parser (>=2) and @tabnas/jsonic are peer dependencies. Requires
Node >=24.
Example
import { Tabnas } from '@tabnas/parser'
import { jsonic } from '@tabnas/jsonic'
import { Markdown } from '@tabnas/markdown'
const j = new Tabnas().use(jsonic).use(Markdown)
j.parse('name,age\nAlice,30\nBob,25') // => [{ name: 'Alice', age: '30' }, { name: 'Bob', age: '25' }]
// quoted fields use "" to escape a quote:
j.parse('a\n"b""c"') // => [{ a: 'b"c' }]Documentation
Documentation follows the Diátaxis framework:
- Tutorial — a guided first run.
- How-to guide — task recipes (delimiters, no-header, streaming, errors, embedded JSON).
- Reference — the full API, every option, and the grammar accepted.
- Concepts — how the plugin works on the engine and why.
For the Go version, see ../go/README.md.
Grammar diagram
The live grammar as a railroad diagram (regenerated with
@tabnas/railroad):
ASCII version: doc/grammar.txt. The grammar source is the
top-level markdown-grammar.jsonic, embedded by
embed-grammar.js during npm run build.
License
Copyright (c) 2021-2025 Richard Rodger and other contributors, MIT License.
