# Install

```sh
npm install @memomori-app/charon
```

Charon needs Node 22.18 or later. It ships as ES modules.

## Optional packages

Some modules need a package you install only if you use them:

| Package       | Needed by                         |
| ------------- | --------------------------------- |
| `pele`        | `diagrams` and `mermaid` fences   |
| `maplibre-gl` | `geojson-map` and `embedded-maps` |

Without one, the module that needs it throws a `CharonError` that names the
package.

## Imports

The root path holds the functions most projects use:

```ts
import {
  renderToHtml,
  createRenderer,
  createMarkdown,
  defaultFences,
  preprocessSource,
  renderStaticPage,
  extractToc,
  slugify,
  CharonError,
} from '@memomori-app/charon'
```

Every other module has its own path, such as `@memomori-app/charon/assets`. See
[Modules](modules.md).

## Safety

The parser keeps raw HTML. Sanitize its output before you put text from users
in a page, with DOMPurify or your own sanitizer.
