Registry / serialization / mdt2json

mdt2json

JSON →
library1.1.0jsnpmunverified

A lightweight Markdown table to minified JSON transpiler with CLI and programmatic API. v1.1.0 released 2025-07-29. Supports converting markdown tables to compact JSON, including optional HTML inclusion. Ships TypeScript types. Differentiators: no dependencies, ESM/CJS dual module, simple API with parse function and CLI tool. Compared to alternatives like markdown-table-to-json, this offers minified output and HTML embedding.

npm install mdt2json
INSTALL
IMPORT
SIG · MDT2JSON
M
mdt2json
serializationjavascriptv1.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.

parse
import { parse } from 'mdt2json'
const parse = require('mdt2json')
ESM only; using require will fail.
default
import mdt2json from 'mdt2json'
const mdt2json = require('mdt2json')
Default export is the parse function; use named import for clarity.
parse (type)
import type { ParseOptions } from 'mdt2json'
Type imports available for TypeScript users.

Parse a markdown table string to minified JSON array, demonstrating basic usage with ESM import.

import { parse } from 'mdt2json'; const markdown = `| Name | Age | | --- | --- | | Alice | 30 | | Bob | 25 |`; const json = parse(markdown); console.log(json); // [["Name","Age"],["Alice",30],["Bob",25]]
mdt2json --version
Debug
Known issues
breakingPackage renamed from 'mdtable2json' to 'mdt2json' between v0.2.0 and v1.0.0. Existing imports from 'mdtable2json' will break.
fix
Update all imports to 'mdt2json' and reinstall.
affects: >=0.0.0 <1.0.0
deprecatedCLI flag --include-html added in v1.1.0 is experimental and may change in future releases.
fix
Use with caution; no fix needed yet.
affects: >=1.1.0
gotchaModule is ESM-only (type: module in package.json). Using require() or running in CommonJS environment will throw an error.
fix
Set "type": "module" or use dynamic import: const { parse } = await import('mdt2json').
affects: >=1.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/mdt2json/dist/index.js from /path/to/project/index.js not supported.
Package is ESM-only; CommonJS require() fails.
fix
Use import or dynamic import; set type: module in package.json.
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

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