---
title: "Overview"
description: "Read and write the files of a translations repository from code."
canonical_url: "https://diglot.sh/store/overview"
---
# Overview

> Read and write the files of a translations repository from code.

`@diglot/store` is the layer between diglot and the file system. It loads `diglot.config.ts` and `sources.yml`, reads source documents through git, reads and writes translation records and manifests, builds locale bundles, and loads glossaries, styles and locale state. The CLI and the Action are built on it, and it is the package to use when you write your own tooling around a translations repository.

<package-info directory="packages/store" install="pnpm add @diglot/store @diglot/core" name="@diglot/store">



</package-info>

It needs Node.js 22.18 or later. Its `@diglot/store/runtime` entry imports no Node built-ins, for servers and edge runtimes that read a store from an archive.

## The layout it manages

```text
diglot.config.ts
sources.yml
glossary.yml
<locale>/
  glossary.yml
  style.yml
  locale.yml
  segments/<hh>/<hash>.json
.diglot/manifest/<source>.json
.diglot/policy.json
dist/<locale>.json
```

Each file is described in [repository layout](https://diglot.sh/guide/start/repository-layout).

## A short tour

```ts
import { build, createManifest, liveHashes, loadConfig, loadLocale, readManifests, readSource, writeManifest, writeRecord } from '@diglot/store'

const config = await loadConfig('.')
const snapshot = await readSource(config.sources[0], config.root)

await writeRecord(config.root, 'fr', record)
const records = await loadLocale(config.root, 'fr')

await build(config.root, { locales: config.locales, only: liveHashes(await readManifests(config.stateDir)) })
```

## Where to go next

- [Config and sources](https://diglot.sh/store/config-and-sources) covers `loadConfig`, `readSource` and `ensureCheckouts`.
- [Records and bundles](https://diglot.sh/store/records-and-bundles) covers reading, writing and building records.
- [Manifests](https://diglot.sh/store/manifests) covers the source manifests and live hashes.
- [Locale files](https://diglot.sh/store/locale-files) covers glossaries, styles and locale state.
- [Runtime](https://diglot.sh/store/runtime) covers reading a store from an archive on a server, without a checkout.


## Sitemap

See the full [sitemap](https://diglot.sh/sitemap.md) for all pages.
