# mdx-frontmatter-loader

> frontmatter loader for @mdx-js

Latest version **0.1.1** (published 2018-08-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install mdx-frontmatter-loader
pnpm add mdx-frontmatter-loader
yarn add mdx-frontmatter-loader
bun add mdx-frontmatter-loader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2018-08-04 |
| First published | 2018-08-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 6.9.0 |
| Dependencies | 1 |
| Unpacked size | 1.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | some1else |
| Maintainers | some1else |
| Keywords | webpack, mdx, frontmatter |

## Links

- npm: https://www.npmjs.com/package/mdx-frontmatter-loader
- Repository: https://github.com/some1else/mdx-frontmatter-loader
- Issues: https://github.com/some1else/mdx-frontmatter-loader/issues
- npm.io page: https://npm.io/package/mdx-frontmatter-loader

## Dependencies (1)

- [front-matter](https://npm.io/package/front-matter.md) ^2.1.2

## 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) — 2018-08-04
- 0.1.0 — 2018-08-04

## README

# mdx-frontmatter-loader

Use to add front-matter to @mdx-js exports.

Dependencies:

- `remark-frontmatter`
- `front-matter`

## Config

```
{
  test: /\.md$/,
  use: [
    'babel-loader',
    {
      // Adds frontmatter to export
      loader: 'mdx-frontmatter-loader',
    },
    {
      loader: '@mdx-js/loader',
      options: {
        mdPlugins: [
          [
            // Remove frontMatter from body output
            require('remark-frontmatter'), 
            { type: 'yaml', marker: '-', fence: '---' },
          ],
        ],
      },
    },
  ],
},
```

## Usage


Import both Mdx component and frontmatter attributes:

```
import WhateverMarkdown, { attributes as whateverMetadata } from './whatever.md'
```

Then use in JSX like so:

```
<h1>{ whateverMetadata.title }</h1>
<WhateverMarkdown />
```

MIT (c) some1else

---
_Source: https://npm.io/package/mdx-frontmatter-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
