# collections

Every collection in your config, for a name only known at runtime, eg a route param. Import a collection by its name otherwise, which bundles only that collection. Provided by the tomekit() Vite plugin, or by tomekit/register outside Vite; importing it without either throws.

> Every page: https://tomekit.aayush.cv/llms.txt

```ts
const collections: Collections<Source>;
```

Defined in: [content.ts:61](https://github.com/aayushbtw/tomekit/blob/main/packages/tomekit/src/content.ts#L61)

Every collection in your config, for a name only known at runtime, eg a route param. Import a collection by its name otherwise, which bundles only that collection. Provided by the `tomekit()` Vite plugin, or by `tomekit/register` outside Vite; importing it without either throws.

## Example

```ts
import { collections } from "tomekit/content";

collections.names(); // ["notes", "posts"]
if (collections.has(params.collection)) collections.get(params.collection).slugs();
```
