mdt2json-cli
raw JSON → 0.1.0 verified Fri May 01 auth: no javascript
A CLI tool that transpiles Markdown tables into minified JSON arrays. Current stable version is 0.1.0. Created as an early-stage utility, it has a very specific focus and limited scope. No release cadence established. Key differentiators: minimal output, no dependencies, works as a command-line filter. However, it has no tests, no documentation, and is likely unstable.
Common errors
error Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'mdt2json-cli' ↓
cause Package is ESM-only but project uses CommonJS require().
fix
Change to import statement or set { "type": "module" } in package.json.
error TypeError: mdt2json is not a function ↓
cause Named import used as default import incorrectly.
fix
Use import { mdt2json } from 'mdt2json-cli' or import mdt2json from 'mdt2json-cli'.
Warnings
gotcha Package version 0.1.0 has zero tests, zero documentation, and is not production-ready. ↓
fix Avoid using in production until stable release.
breaking ESM-only: CommonJS require() will throw MODULE_NOT_FOUND. ↓
fix Use import syntax or dynamic import().
gotcha CLI expects input via stdin; no file argument accepted. ↓
fix Pipe file contents: cat input.md | npx mdt2json-cli
gotcha Output is minified JSON; no pretty-print option. ↓
fix Use jq or other tools to format output if needed.
Install
npm install mdt2json-cli yarn add mdt2json-cli pnpm add mdt2json-cli Imports
- default wrong
const mdt2json = require('mdt2json-cli')correctimport mdt2json from 'mdt2json-cli' - mdt2json wrong
const { mdt2json } = require('mdt2json-cli')correctimport { mdt2json } from 'mdt2json-cli' - transform wrong
import transform from 'mdt2json-cli'correctimport { transform } from 'mdt2json-cli'
Quickstart
echo '| a | b |\n|---|---|\n| 1 | 2 |' | npx mdt2json-cli