# Fumadocs MDX (the built-in content source): Node.js
URL: /docs/mdx/loader/node
Source: https://raw.githubusercontent.com/fuma-nama/fumadocs/refs/heads/main/apps/docs/content/docs/mdx/(integrations)/loader/node.mdx

Access content in Node.js runtime.

## Setup [#setup]

Run your scripts with a TypeScript runner like [tsx](https://tsx.is), because `lib/source.ts` of the templates has extensionless imports and path aliases that Node.js can't resolve.

```ts title="scripts/example.ts"
import { register } from 'fumadocs-mdx/node';

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

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

```npm
npx tsx scripts/example.ts
```

The loader only transforms ES modules. Set `"type": "module"` in your `package.json`, so `lib/source.ts` loads as one. It applies to every `.js` file of the package, so convert CommonJS files like `next.config.js` to ESM first.

The `register()` function accepts options:

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