New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

markdown-with-metadata-loader

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-with-metadata-loader

Webpack loader for markdown that will parse out yaml metadata in the standard header

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

markdown-with-metadata-loader

load markdown including yaml metadata with Webpack

returns data in an object with metadata and contents

const theMarkdown = require('somefile.md');
console.log(theMarkdown.metadata); // js object of parsed yaml metadata from the markdown file
console.log(theMarkdown.contents); // The actual, unprocessed markdown contents of the file

In the case of no yaml metadata, the metadata property will contain an empty object. Metadata should be delimited in the standard jekyll/markdown fashion, with a preceding and trailing lines with 3 hyphens, like so

---
author: steve stevers
description: stuff
---
# I'm markdown
yes I are

To use, install

npm install --save-dev markdown-with-metadata-loader

then add to the module.loaders section your webpack.config.js

    {
      test: /\.md$/,
      loader: 'markdown-with-metadata-loader'
    },

FAQs

Package last updated on 23 May 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc