# API Reference

> API reference for @anymux/union.

Source: https://anymux-docs.n.yatsyk.com/docs/union/api

# API Reference

## `UnionFileSystem`

Merges multiple `IFileSystem` instances into a single virtual file system.

### Constructor

```ts
new UnionFileSystem(options: UnionFileSystemOptions)
```

### Options

| Option   | Type            | Description                                      |
| -------- | --------------- | ------------------------------------------------ |
| `layers` | `IFileSystem[]` | File systems in priority order (first = highest) |

### Methods

Implements all `IFileSystem` methods: `readFile`, `writeFile`, `readDir`, `stat`, `mkdir`, `rm`, `exists`.
