JSPM

parsemarkjs

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2270
  • Score
    100M100P100Q109457F
  • License MIT

A lightweight JavaScript library for parsing Markdown metadata and content separatly

Package Exports

  • parsemarkjs
  • parsemarkjs/ParseMark.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (parsemarkjs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ParseMark.js

A lightweight JavaScript library for parsing Markdown metadata and content separatly

License

Installation

Using npm

npm install parsemarkjs

Using CDN

Include the following script tag in your HTML file:

<script src="https://cdn.jsdelivr.net/gh/SH20RAJ/ParseMark@main/ParseMark.js"></script>

Usage

Constructor

const markdown = `
---
title: "Sample Post"
tags: javascript, library, markdown
datePublished: Fri, 04 Feb 2024 12:00:00 GMT
---

# Sample Post

This is a sample post content.
`;

const parser = new ParseMark(markdown);

getMetadata()

const metadata = parser.getMetadata();
console.log('Metadata:', metadata);

getRawMetadata()

const rawMetadata = parser.getRawMetadata();
console.log('Raw Metadata:', rawMetadata);

getContent()

const content = parser.getContent();
console.log('Content:', content);

Example Output

Screenshot 2024-02-02 at 3 14 25 PM

License

This project is licensed under the MIT License - see the LICENSE file for details.