FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

xyxjs/md-cache · GitHub

/ md-cache Public

Repository files navigation

md-cache

Introduction

It is a light weight way to get your markdown files by only rendering it when it changes.

Spawn .cache dir in your root dir.

Support frontmatter.

Install

npm i markdown-cache

Use

Use express server for example.

import express from "express";
import MarkdownCache from "markdown-cache";
import markdownIt from "markdown-it";

const app = express();

const md = new markdownIt();

const mdCacheEngine = new MarkdownCache({
  md: md, // markdown-it, error if not get it
  root: "./", // working root dir, default to process.cwd()
  mdRoot: "markdown" // dir to your md files, default to "markdown"
});

app.use(/\.md$/, (req, res, next) => {
  res.send(await mdCacheEngine.html(req.path));
});

app.listen(8080);

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages


Back | FazBrowse Home | New Git URL