mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-27 11:01:38 -04:00
15 lines
403 B
JavaScript
15 lines
403 B
JavaScript
const { read } = require('to-vfile');
|
|
const remark = require('remark');
|
|
const directive = require('remark-directive');
|
|
const frontmatter = require('remark-frontmatter');
|
|
|
|
(async () => {
|
|
const path = './example.md';
|
|
const file = await read(path);
|
|
await remark()
|
|
.use(directive)
|
|
.use(frontmatter, ['yaml'])
|
|
.use(() => tree => console.log(JSON.stringify(tree)))
|
|
.process(file);
|
|
})();
|