Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including @node-novel/md-loader with all npm packages installed. Try it out:

require("gray-matter/package.json"); // gray-matter is a peer dependency. require("node-novel-info/package.json"); // node-novel-info is a peer dependency. var mdLoader = require("@node-novel/md-loader")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@node-novel/md-loader v1.0.4

支援 Front Matter 的 node-novel-info / mdconf

@node-novel/md-loader

支援 Front Matter 的 node-novel-info / mdconf

install

npm install @node-novel/md-loader node-novel-info

請注意必須要手動額外安裝 node-novel-info 這是為了防止當多個 node-novel-info 同時存在時的除錯問題

請注意必須要手動額外安裝 node-novel-info 這是為了防止當多個 node-novel-info 同時存在時的除錯問題

demo

see api in API

demo.ts

import { parse } from '@node-novel/md-loader';

let k = parse(`
---
title: Home
---
# novel

- title: 破滅の魔導王とゴーレムの蛮妃
`, {
    parseOptions: {
        //lowCheckLevel: true,
        throw: false,
    },
});

let r = k.stringify({
    data: {
        //...k.data,
        //kkk: 777,
    },
    //content: k.content,
    mdconf: {
        ...k.mdconf,
        aaa: {
            bbb: 777,
        },
    },
});

let r2 = k.stringify(k);

console.dir(k, {
    colors: true,
});

console.log(r);

console.log('---------------------------');

console.log(r2);
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free