---
title: "content.init()"
description: "Initialize the instance by restoring the freshest index, or reading source metadata."
canonical_url: "https://content.comark.dev/reference/content/init"
---
# content.init()

> Initialize the instance by restoring the freshest index, or reading source metadata.

## `content.init(options?)`

Initializes the instance: restores the freshest index available, or reads source metadata when there is none. Called lazily by [`get`](https://content.comark.dev/reference/content/get) / [`list`](https://content.comark.dev/reference/content/list) / [`navigation`](https://content.comark.dev/reference/content/navigation), so you rarely call it yourself.

**Parameters:**

- `options?`: optional, see [Options](#options).

**Returns:** `Promise<void>`

```ts [preload.ts]
await content.init({ partial: false })   // warm every body at boot
```

## Options

`init()` accepts the following options:

| Option                                | Type      | Default | Description                                                    |
| ------------------------------------- | --------- | ------- | -------------------------------------------------------------- |
| [`partial`](#options-partial)         | `boolean` | `true`  | Read frontmatter only and skip body parsing.                   |
| [`ignoreCache`](#options-ignorecache) | `boolean` | `false` | Rebuild from the source of truth, ignoring every stored index. |

### `partial`

Defaults to `true`: init reads each entry's frontmatter meta to build the index, but does not parse bodies. Pass `false` to parse every body up front, warming the cache at boot instead of lazily on first `get()`.

### `ignoreCache`

Pass `true` to rebuild the index directly from the source of truth, ignoring both the persisted index and any stored [snapshot](https://content.comark.dev/sources/snapshot) data. When a [parsed source](https://content.comark.dev/sources/snapshot) has no raw origin, its data is still the only thing to read, so it is used.

## Usage

```ts [preload.ts]
await content.init({ partial: false })
```


## Sitemap

See the full [sitemap](https://content.comark.dev/sitemap.md) for all pages.
