# Backup API for Bun and Node

Every public class, function and type of the Backup engine in `@tinyshed/tinystore`, generated from its source. The [Backup guide](https://tinyshed.org/tinystore/docs/guides/backup) explains how to use them, and the [Python](https://tinyshed.org/tinystore/docs/reference/python/backup), [Go](https://tinyshed.org/tinystore/docs/reference/go/backup) and [Rust](https://tinyshed.org/tinystore/docs/reference/rust/backup) pages list the same API.

## BackupOptions

```ts
interface BackupOptions {
    /**
     * files of the program's it includes, by their paths inside the store's
     * directory, such as 'secret.key', which a restore puts back where they
     * were: a backup holds none unless named
     */
    include?: readonly string[]
    /**
     * includes the store's encryption key, as it is, which a backup leaves
     * out otherwise: the zip is not encrypted, so a backup with the key opens
     * every value it holds
     */
    includeEncryptionKey?: boolean
}
```

What a backup takes beside every engine's files.

## Backup

```ts
interface Backup {
    /** the files, the engines' and those it was told to take */
    files: number
    /** their bytes, the zip's own fields aside */
    bytes: number
    /**
     * the store seals values with an encryption key the backup does not
     * hold: they open with that key alone, kept apart
     */
    keyLeftOut: boolean
}
```

What a backup holds.
