yaml-frontmatter-loader

[![npm][npm]][npm-url] [![node][node]][node-url] [![deps][deps]][deps-url] [![tests][tests]][tests-url] [![chat][chat]][chat-url]

YAML frontmatter loader for webpack. Converts YAML in files to JSON.

Requirements

This module requires a minimum of Node v6.9.0 and Webpack v4.0.0.

Getting Started

To begin, you’ll need to install yaml-frontmatter-loader:

  1. $ npm install yaml-frontmatter-loader --save-dev

Then add the loader to your webpack config. For example:

  1. const json = require('yaml-frontmatter-loader!./file.md');
  2. // => returns file.md as javascript object
  1. // webpack.config.js
  2. module.exports = {
  3. module: {
  4. rules: [
  5. {
  6. test: /\.md$/,
  7. use: [ 'json-loader', 'yaml-frontmatter-loader' ]
  8. }
  9. ]
  10. }
  11. }

And run webpack via your preferred method.

License

MIT MIT” class=”icon-link” href=”#mit”>