Gathering detailed insights and metrics for remark-mdx-frontmatter
Gathering detailed insights and metrics for remark-mdx-frontmatter
Gathering detailed insights and metrics for remark-mdx-frontmatter
Gathering detailed insights and metrics for remark-mdx-frontmatter
A remark plugin for converting frontmatter metadata into MDX exports
npm install remark-mdx-frontmatter
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
102 Stars
88 Commits
6 Forks
4 Watching
1 Branches
2 Contributors
Updated on 13 Nov 2024
TypeScript (53.46%)
JavaScript (46.54%)
Cumulative downloads
Total Downloads
Last day
-11.1%
80,273
Compared to previous day
Last week
4.9%
497,429
Compared to previous week
Last month
12.5%
2,090,865
Compared to previous month
Last year
51.2%
18,784,788
Compared to previous year
A remark plugin for converting frontmatter metadata into MDX exports
This package depends on the AST output by remark-frontmatter
1npm install remark-frontmatter remark-mdx-frontmatter
This remark plugin takes frontmatter content, and outputs it as JavaScript exports. Both YAML and TOML frontmatter data are supported.
For example, given a file named example.mdx
with the following contents:
1--- 2hello: frontmatter 3--- 4 5Rest of document
The following script:
1import { readFile } from 'node:fs/promises' 2 3import { compile } from '@mdx-js/mdx' 4import remarkFrontmatter from 'remark-frontmatter' 5import remarkMdxFrontmatter from 'remark-mdx-frontmatter' 6 7const { value } = await compile(await readFile('example.mdx'), { 8 jsx: true, 9 remarkPlugins: [remarkFrontmatter, remarkMdxFrontmatter] 10}) 11console.log(value)
Roughly yields:
1export const frontmatter = { 2 hello: 'frontmatter' 3} 4 5export default function MDXContent() { 6 return <p>Rest of document</p> 7}
The default export is a remark plugin.
name
: The identifier name of the variable the frontmatter data is assigned to. (Default:
frontmatter
).parsers
: A mapping A mapping of node types to parsers. Each key represents a frontmatter node
type. The value is a function that accepts the frontmatter data as a string, and returns the
parsed data. By default yaml
nodes will be parsed using yaml
and toml
nodes using toml
.This project is compatible with Node.js 18 or greater.
MIT © Remco Haszing
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
packaging workflow detected
Details
Reason
2 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 5
Details
Reason
Found 1/29 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More