Hanzo DocsHanzo Docs
Hanzo Docs MDXThe official content source
Project
Guide
Getting StartedPerformance
Accessing Collections
Integrations
Next.jsVite
Runtime Loader
Bun
Node.js
Configuration
CollectionsGlobal OptionsMDX Presets
Features
IncludeLast Modified TimeLazy LoadingGenerate TypesWorkspace
On this page
Runtime Loader

Node.js

Access content in Node.js runtime.

Setup

Make sure to run the script under ESM environment.

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

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

// accessing content
const { source } = await import('./lib/source');
console.log(source.getPages());
How is this guide?
Bun
Access content in Bun.
Collections
Collection of content data for your app
On this page
Setup