# yaml-cfn

> Parser and schema for CloudFormation YAML template tags.

Latest version **0.3.2** (published 2022-10-28) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install yaml-cfn
pnpm add yaml-cfn
yarn add yaml-cfn
bun add yaml-cfn
```

Provides the command `yaml-cfn`.

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2022-10-28 |
| First published | 2017-10-20 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 22.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 32 |
| Author | Dmitry S, Grist Labs |
| Maintainers | dsagal2 |
| Keywords | yaml, cloudformation, aws, json |

## Links

- npm: https://www.npmjs.com/package/yaml-cfn
- Repository: https://github.com/gristlabs/yaml-cfn
- Homepage: https://github.com/gristlabs/yaml-cfn#readme
- Issues: https://github.com/gristlabs/yaml-cfn/issues
- npm.io page: https://npm.io/package/yaml-cfn

## Dependencies (1)

- [js-yaml](https://npm.io/package/js-yaml.md) ^4.0.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.3.2 (latest) — 2022-10-28
- 0.3.1 — 2021-06-30
- 0.3.0 — 2021-01-28
- 0.2.3 — 2019-10-08
- 0.2.2 — 2019-07-16
- 0.2.1 — 2019-04-26
- 0.2.0 — 2017-11-28
- 0.1.1 — 2017-10-20
- 0.1.0 — 2017-10-20

## README

# yaml-cfn

![CI](https://github.com/gristlabs/yaml-cfn/workflows/CI/badge.svg)
[![npm version](https://badge.fury.io/js/yaml-cfn.svg)](https://badge.fury.io/js/yaml-cfn)

> Parser and schema for CloudFormation YAML template tags.

Implements support for AWS-specific CloudFormation YAML schema.

The implementation and tests are based on the official AWS Python client
[aws-cli](https://github.com/aws/aws-cli). It supports all intrinsic CloudFormation functions listed in
[AWS docs](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html)
as of October 2017.

## Installation

```bash
npm install --save-dev yaml-cfn
```

## Usage

```js
const { yamlParse, yamlDump } = require('yaml-cfn');

const input = `
Key:
  - !GetAtt Foo.Bar
  - !Equals [!Ref Baz, "hello"]
`;

const parsed = {
  "Key": [
    {"Fn::GetAtt": ["Foo", "Bar"]},
    {"Fn::Equals": [{"Ref": "Baz"}, "hello"]}
  ]
};

assert.deepEqual(yamlParse(input), parsed);
assert.deepEqual(yamlParse(yamlDump(parsed)), parsed);
```

The module uses [js-yaml](https://github.com/nodeca/js-yaml). The schema it uses is also exported,
and may be used e.g. like so:
```js
const { schema } = require('yaml-cfn');
const yaml = require('js-yaml');
yaml.safeLoad(input, { schema: schema })
```

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