https://github.com/hougesen/mrkdwny
Markdown to HTML parser
https://github.com/hougesen/mrkdwny
markdown markdown-parser markdown-to-html
Last synced: about 2 months ago
JSON representation
Markdown to HTML parser
- Host: GitHub
- URL: https://github.com/hougesen/mrkdwny
- Owner: hougesen
- License: mit
- Created: 2022-07-04T19:53:04.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-12-01T03:40:38.000Z (6 months ago)
- Last Synced: 2025-03-15T01:27:17.035Z (2 months ago)
- Topics: markdown, markdown-parser, markdown-to-html
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/mrkdwny
- Size: 263 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mrkdwny
Parser for turning markdown into HTML.
[](https://github.com/hougesen/mrkdwny/actions/workflows/ci.yml)
[](https://github.com/hougesen/mrkdwny/actions/workflows/npm-publish.yml)
[](https://badge.fury.io/js/mrkdwny)## Install
```sh
npm i mrkdwny
```## Usage
```ts
import { parseMarkdown } from 'mrkdwny';
// or the following if you are using mjs/ts
const parseMarkdown = require('mrkdwny').parseMarkdown;const dummyMarkdown = `
---
title: markdown-example
---# This is a h1 heading
## This is a h2 heading
### This is a h3 heading
#### This is a h4 heading
##### This is a h5 heading
###### This is a h6 heading
This is a paragraph
[this is a link](https://mhouge.dk)
this is a paragraph with a link inside [link](https://google.com) :D

`;
const result = parseMarkdown(fileContent);
console.log(result.metadata);
// { title: 'markdown-example' }console.log(result.html);
//This is a h1 heading
//This is a h2 heading
//This is a h3 heading
//This is a h4 heading
//This is a h5 heading
//This is a h6 heading
//This is a paragraph
//
//this is a paragraph with a link inside link :D
//![]()
```