# markdown-code-block-meta

> A library to parse/stringify metadata of markdown code block

Latest version **0.1.1** (published 2026-01-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install markdown-code-block-meta
pnpm add markdown-code-block-meta
yarn add markdown-code-block-meta
bun add markdown-code-block-meta
```

## Health

**Score 65/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2026-01-13 |
| First published | 2022-08-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20.0.0 |
| Dependencies | 0 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 3 |
| Author | Eric Chen |
| Maintainers | airkro |
| Keywords | code-block, key-value, markdown, meta, metadata, pair, remark |

## Links

- npm: https://www.npmjs.com/package/markdown-code-block-meta
- Repository: https://github.com/show-docs/markdown-code-block-meta
- Issues: https://github.com/show-docs/markdown-code-block-meta/issues
- npm.io page: https://npm.io/package/markdown-code-block-meta

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.1.1 (latest) — 2026-01-13
- 0.1.0 — 2025-10-07
- 0.0.2 — 2022-08-09
- 0.0.1 — 2022-08-09
- 0.0.0 — 2022-08-09

## README

# markdown-code-block-meta

A library to parse/stringify metadata of markdown code block.

[![npm][npm-badge]][npm-url]
[![github][github-badge]][github-url]
![node][node-badge]

[npm-url]: https://www.npmjs.com/package/markdown-code-block-meta
[npm-badge]: https://img.shields.io/npm/v/markdown-code-block-meta.svg?style=flat-square&logo=npm
[github-url]: https://github.com/show-docs/markdown-code-block-meta
[github-badge]: https://img.shields.io/npm/l/markdown-code-block-meta.svg?style=flat-square&colorB=blue&logo=github
[node-badge]: https://img.shields.io/node/v/markdown-code-block-meta.svg?style=flat-square&colorB=green&logo=node.js

## Installation

```bash
npm install markdown-code-block-meta --save
```

## Usage

Parsing markdown with [remark](https://remark.js.org).

````markdown
```js title="Here is an example"

```
````

A Code block will turn into:

```json
{
  "lang": "js",
  "meta": "title=\"Here is an example\""
}
```

Parsing metadata like this:

```js
import { getValue, parse, stringify } from 'markdown-code-block-meta';

const input =
  '-8=。是 ==0 ===f=5 =9 dd k=dsds op="s 7" d-p="" sss=`7 u-` rj= lp=\' ds ds\' t="`"';

const result = parse(input);
/* result = Map {
  '-8' => '。是',
  '==0' => undefined,
  '===f=5' => undefined,
  '=9' => undefined,
  'dd' => undefined,
  'k' => 'dsds',
  'op' => '"s 7"',
  'd-p' => '""',
  'sss' => '`7 u-`',
  'rj=' => undefined,
  'lp' => '\' ds ds\'',
  't' => '"`"'
} */

stringify(result); // same as input

getValue('"abc"'); // abc
getValue('`abc`'); // abc
getValue("'abc'"); // abc
```

## Related

- [remark-code-example](https://github.com/show-docs/remark-code-example)
- [remark-kroki](https://github.com/show-docs/remark-kroki)
- [remark-docusaurus](https://github.com/show-docs/remark-docusaurus)

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