mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-25 09:02:09 -05:00
16 lines
446 B
JavaScript
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);
|
|
})();
|