Fumadocs

Node.js

在 Node.js 运行时访问内容。

安装

🌐 Setup

确保在 ESM 环境下运行脚本。

🌐 Make sure to run the script under ESM environment.

scripts/example.js
import { register } from 'node:module';

register('fumadocs-mdx/node/loader', import.meta.url);

// accessing content
const { source } = await import('./lib/source');
console.log(source.getPages());

Last updated on

On this page