Skip to main content


The Deno Standard Library
Go to Latest
variable extract
import { extract } from "";

Extracts and parses YAML, TOML, or JSON from the metadata of front matter content, depending on the format.


Example 1

import { extract } from "";

const output = `---json
  "title": "Three dashes marks the spot"
Hello, world!`;
const result = extract(output);

result.frontMatter; // '{\n "title": "Three dashes marks the spot"\n}'
result.body; // "Hello, world!"
result.attrs; // { title: "Three dashes marks the spot" }