Files
freeCodeCamp/tools/challenge-parser/parser/tools/parse-md.js
2021-02-22 09:14:12 +05:30

16 lines
446 B
JavaScript

const { read } = require('to-vfile');
const remark = require('remark');
const directives = require('remark-directive');
const stringify = require('remark-stringify');
(async () => {
const path = './example.md';
const file = await read(path);
const contents = await remark()
.use(directives)
.use(() => tree => console.dir(tree, { depth: null, colors: true }))
.use(stringify)
.process(file);
console.log(contents);
})();