# frontmatter-markdown-loader

> Webpack loader for Front Matter Markdown file to get front matter attributes, compiled markdown and React/Vue component which renders compiled markdown

Latest version **3.7.0** (published 2022-04-12) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities; high maintenance score.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.7.0 |
| Published | 2022-04-12 |
| First published | 2018-03-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 11.6 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 250 |
| Author | Kengo Hamasaki |
| Maintainers | hmsk |
| Keywords | webpack, markdown, frontmatter, vue, loader, react |

## Links

- npm: https://www.npmjs.com/package/frontmatter-markdown-loader
- Repository: https://github.com/hmsk/frontmatter-markdown-loader
- Homepage: https://github.com/hmsk/frontmatter-markdown-loader#readme
- Issues: https://github.com/hmsk/frontmatter-markdown-loader/issues
- npm.io page: https://npm.io/package/frontmatter-markdown-loader

## Dependencies (3)

- [markdown-it](https://npm.io/package/markdown-it.md) ^12.0.0
- [front-matter](https://npm.io/package/front-matter.md) ^4.0.0
- [loader-utils](https://npm.io/package/loader-utils.md) ^2.0.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 3.7.0 (latest) — 2022-04-12
- 3.6.2-0 (beta) — 2020-11-22
- 3.6.3 — 2021-07-06
- 3.6.2 — 2020-11-22
- 3.6.1 — 2020-10-07
- 3.6.1-1 — 2020-10-06
- 3.6.1-0 — 2020-10-06
- 3.6.0 — 2020-06-16
- 3.6.0-1 — 2020-06-08
- 3.6.0-0 — 2020-06-02
- 3.5.0 — 2020-05-22
- 3.4.3 — 2020-05-09
- 3.4.3-0 — 2020-05-08
- 3.4.2 — 2020-05-02
- 3.4.1 — 2020-04-30
- … 36 more at https://npm.io/package/frontmatter-markdown-loader/versions

## README

# frontmatter-markdown-loader

[![npm](https://img.shields.io/npm/v/frontmatter-markdown-loader.svg?style=for-the-badge)](https://www.npmjs.com/package/frontmatter-markdown-loader)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/hmsk/frontmatter-markdown-loader/Node%20CI?style=for-the-badge)](https://github.com/hmsk/frontmatter-markdown-loader/actions?query=workflow%3A%22Node+CI%22)

Webpack Loader for [Front Matter](https://jekyllrb.com/docs/front-matter/) files (.md) which returns:

- Front Matter attributes
- Compiled markdown as HTML
- [Compiled markdown as a React component](https://hmsk.github.io/frontmatter-markdown-loader/react.html)
- [Compiled markdown as a Vue component](https://hmsk.github.io/frontmatter-markdown-loader/vue.html)

This FrontMatter markdown file `something.md`:

```md
---
subject: Hello
tags:
  - tag1
  - tag2
---
# Title

message
```

is loadable as:

```js
import fm from "something.md"

fm.attributes // FrontMatter attributes => { subject: "Hello", tags: ["tag1", "tag2"] }
fm.html // Compiled markdown as HTML => "<h1>Title</h1>\n<p>message</p>\n"
fm.react // Component function for React which renders compiled markdown (Disabled as default)
fm.vue.component // Extendable component object for Vue which renders compiled markdown (Disabled as default)
```

📚 See the [documentation](https://hmsk.github.io/frontmatter-markdown-loader/) for the further detail.

<details>
<summary>🔰 You have trouble with missing object?</summary>

The loader got the breaking changes in the latest major update. The article which you referred might premise on the old version. Check the installed version, if that says `1.x.y`, see [this guide](https://hmsk.github.io/frontmatter-markdown-loader/migration).
</details>

## Samples

- [vue-cli app](https://github.com/hmsk/frontmatter-markdown-loader-vue-sample)
- [Nuxt.js](https://github.com/hmsk/frontmatter-markdown-loader-nuxt-sample)
- [NextJS (w/ Netlify CMS)](https://www.netlifycms.org/docs/nextjs/)

## Inspired/Referred

- [egoist/vmark: Convert markdown to Vue component.](https://github.com/egoist/vmark)
- [webpack-contrib/json-loader: json loader module for webpack](https://github.com/webpack-contrib/json-loader)

## License

- [MIT License](LICENSE) Copyright 2018-present Kengo Hamasaki
- And thanks for [Contributors](https://github.com/hmsk/frontmatter-markdown-loader/graphs/contributors)

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