# Function: folderStores()

```ts
function folderStores(directory, options?): StoreFactory;
```

Defined in: [packages/core/src/node/stores.ts:70](https://github.com/leifriksheim/minca/blob/main/core/src/node/stores.ts#L70)

Stores in a data folder several apps and devices share (spec 05 §14).

The folder holds the registry, sealed, and each space as segments, the way
a mirror keeps one in a bucket (`folder`). Everything else is this device's
own, in `local`. Nothing else is read from the folder: whoever can write it
could plant a writer id or a key's last place for this device to take.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `directory` | [`DirectoryHandleLike`](https://minca.dev/api/core/interfaces/DirectoryHandleLike.md) | - |
| `options?` | \{ `basePath?`: `string`; `local?`: [`StoreFactory`](https://minca.dev/api/core/type-aliases/StoreFactory.md); `localKey?`: `CryptoKey` \| `null`; \} | - |
| `options.basePath?` | `string` | Where this account's data starts, e.g. `accounts/<id>/stores` |
| `options.local?` | [`StoreFactory`](https://minca.dev/api/core/type-aliases/StoreFactory.md) | Where this device keeps its own stores, outside the folder. Default: IndexedDB under `minca-pod:<basePath>`. Required without IndexedDB: in memory, a restart would sign at a place it signed before. |
| `options.localKey?` | `CryptoKey` \| `null` | Seals the registry. Without it nothing is sealed. |

## Returns

[`StoreFactory`](https://minca.dev/api/core/type-aliases/StoreFactory.md)
