Fumadocs

Node.js

Access content in Node.js runtime.

Setup

Make sure to run the script under ESM environment.

scripts/example.js
import { register } from 'fumadocs-mdx/node';

// register the Node.js loader
register();

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

The register() function accepts options:

register({
  configPath: '...',
  // ...
});

How is this guide?

Last updated on

On this page