Registry / serialization / mdt2json-ts

mdt2json-ts

JSON →
library0.1.0jsnpmunverified

mdt2json-ts is a TypeScript-based transpiler that converts Markdown tables into minified JSON arrays. Version 0.1.0 is the initial release, with no active release cadence. It differentiates from similar tools by producing compact JSON output without intermediate steps, targeting developers who need to extract structured data from Markdown tables programmatically. The package ships with TypeScript type definitions for type-safe usage.

npm install mdt2json-ts
INSTALL
IMPORT
SIG · MDT2JSON-TS
M
mdt2json-ts
serializationjavascriptv0.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import mdt2json from 'mdt2json-ts'
const mdt2json = require('mdt2json-ts')
ESM-only package; CommonJS require will fail.
parseTable
import { parseTable } from 'mdt2json-ts'
import { parseTable } from 'mdt2json-ts/parseTable'
Named export, not a subpath export.
MarkdownTableParser
import { MarkdownTableParser } from 'mdt2json-ts'
import MarkdownTableParser from 'mdt2json-ts'
Named export, not default.

Demonstrates converting a Markdown table string to a minified JSON array using the default export.

import mdt2json from 'mdt2json-ts'; const markdown = `| Name | Age | |------|-----| | Alice | 30 | | Bob | 25 |`; const json = mdt2json(markdown); console.log(json); // Output: [{"Name":"Alice","Age":"30"},{"Name":"Bob","Age":"25"}]
Debug
Known issues
gotchaTable rows must be separated by newlines; inline tables not supported.
fix
Ensure each row is on its own line.
affects: >=0.1.0
gotchaOnly pipe-separated tables are supported; GFM tables with dashes only.
fix
Use pipe characters and include the separator line.
affects: >=0.1.0
gotchaJSON output is minified; no pretty-print option available.
fix
Use JSON.stringify(result, null, 2) for formatting.
affects: >=0.1.0
Errors
Common errors & fixes
SyntaxError: Unexpected token 'export'
Trying to require an ESM-only module with CommonJS.
fix
Use ESM imports or set type: module in package.json.
TypeError: mdt2json is not a function
Using named import incorrectly as default.
fix
Use import mdt2json from 'mdt2json-ts'
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
mdt2json-ts — npm install mdt2json-ts · libregistry