# @toa.io/yaml

> Toa YAML

Latest version **0.24.0-alpha.0** (published 2023-11-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @toa.io/yaml
pnpm add @toa.io/yaml
yarn add @toa.io/yaml
bun add @toa.io/yaml
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.24.0-alpha.0 |
| Published | 2023-11-16 |
| First published | 2023-03-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 18.0.0 |
| Dependencies | 3 |
| Unpacked size | 15.2 KB |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| Author | Artem Gurtovoi |
| Maintainers | agurtovoi |

## Links

- npm: https://www.npmjs.com/package/@toa.io/yaml
- Repository: https://github.com/toa-io/toa
- Homepage: https://toa.io
- Issues: https://github.com/toa-io/toa/issues
- npm.io page: https://npm.io/package/@toa.io/yaml

## Dependencies (3)

- [js-yaml](https://npm.io/package/js-yaml.md) 4.1.0
- [@toa.io/generic](https://npm.io/package/@toa.io/generic.md) 0.24.0-alpha.0
- [@toa.io/filesystem](https://npm.io/package/@toa.io/filesystem.md) 0.24.0-alpha.0

## Recent versions

- 0.24.0-alpha.0 (latest) — 2023-11-16
- 1.0.0-alpha.272 (alpha) — 2026-09-01
- 0.7.6-alpha.56 (canary) — 2023-05-30
- 0.4.0-dev.9 (dev) — 2023-04-10
- 1.0.0-alpha.254 — 2026-08-11
- 1.0.0-alpha.246 — 2026-08-09
- 1.0.0-alpha.225 — 2026-07-24
- 1.0.0-alpha.224 — 2026-07-24
- 1.0.0-alpha.220 — 2026-07-22
- 1.0.0-alpha.219 — 2026-07-15
- 1.0.0-alpha.218 — 2026-07-15
- 1.0.0-alpha.208 — 2026-04-26
- 1.0.0-alpha.207 — 2026-04-16
- 1.0.0-alpha.182 — 2025-12-05
- 1.0.0-alpha.173 — 2025-09-16
- … 178 more at https://npm.io/package/@toa.io/yaml/versions

## README

# Toa Yaml

Wrapper for [js-yaml](https://github.com/nodeca/js-yaml).

`async load(path: string): object`

`sync(path: string): object`

Read an object from a YAML flie.

`all(path: string): object[]`

Read an array from a multi-document YAML file.

`async save(object: object, path: strgin): void`

Write an object to a YAML file.

`parse(input: string): object`

Parse a YAML document.

`split(input: string): object[]`

Parse a multi-document YAML.

`dump(input: object): string`

Serialize an object to a YAML document.

## YAML Keywords (non-standard)

### <assign

Load an object from the specified file and assign its properties to the current node recursively (
deep merge).

```yaml
<assign: <path>[#fragment]
```

- `path` Absolute or relative path to a file, or a glob pattern.
- `fragment` URL path to a source object (optional)

When using a pattern, all matched files will be processed sequentially.

#### Example

```yaml
# a.yaml
foo:
  bar: 1
```

```yaml
# b.yaml
qux: 'hello'
foo:
  baz: 2
```

```yaml
# c.yaml
<assign: '*.yaml'
```

## Environment variables

YAML documents can contain environment variable placeholders.

```yaml
foo: ${{ BAR }}
```

---
_Source: https://npm.io/package/@toa.io/yaml · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
