Socket
Socket
Sign inDemoInstall

markdown-with-front-matter-loader

Package Overview
Dependencies
12
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-with-front-matter-loader

A webpack loader for markdown with yaml front matter


Version published
Maintainers
1
Weekly downloads
155
decreased by-20.1%

Weekly downloads

Readme

Source

A webpack loader for Markdown files with optional yaml front matter.

Installation

npm install markdown-with-front-matter-loader

Usage

{
  module: {
    loaders: {
      {test: /\.md$/, loader: 'markdown-with-front-matter'},
    ]
  }
}

The result of importing a markdown file will be a JavaScript object with properties from the front matter (as parsed by js-yaml-front-matter) and a __content property containing the transformed markdown. For example,

---
name: Winston the Bulldog
contact:
  email: dogsdontuseemail@hzdg.com
---


I LIKE TO EAT CATS
==================

* Fat cats
* Skinny cats
* Whatever

becomes

{
  name: 'Winston the Bulldog',
  contact: {
    email: 'dogsdontuseemail@hzdg.com',
  },
  __content: '<h1 id="i-like-to-eat-cats">I LIKE TO EAT CATS</h1>\n<ul>\n<li>Fat cats</li>\n<li>Skinny cats</li>\n<li>Whatever</li>\n</ul>\n',
}

Keywords

FAQs

Last updated on 12 Jun 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc