Skip to main content

Get the metadata in markdown

Works with
This package works with Bun
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Browsers
JSR Score
100%
Published
2 months ago (0.0.0)

markmeta

Get the metadata in markdown

import { splitMarkdown } from "@games/markmeta";

// Returns [metadata object, metadata text, content after metadata]
splitMarkdown(`---
title: Title
---

## content
`);
// [{ title: "Title" }, "---\ntitle: Title\n---", "\n\n## content\n"]

splitMarkdown(`---
{
  "title": "Title"
}
---

## content
`);
// [{ title: "Title" }, `---\n{\n  "title": "Title"\n}\n---`, "\n\n## content\n"]

splitMarkdown(`+++
title= Title
+++

## content
`);
// [{ title: "Title" }, `+++\ntitle= Title\n+++`, "\n\n## content\n"]
Built and signed on
GitHub Actions
View transparency log

Add Package

deno add @games/markmeta

Import symbol

import * as mod from "@games/markmeta";

Add Package

npx jsr add @games/markmeta

Import symbol

import * as mod from "@games/markmeta";

Add Package

yarn dlx jsr add @games/markmeta

Import symbol

import * as mod from "@games/markmeta";

Add Package

pnpm dlx jsr add @games/markmeta

Import symbol

import * as mod from "@games/markmeta";

Add Package

bunx jsr add @games/markmeta

Import symbol

import * as mod from "@games/markmeta";