# cfn-template-stream

> Streamingly read/parse/stringify CloudFormation templates

Latest version **1.0.0** (published 2017-03-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install cfn-template-stream
pnpm add cfn-template-stream
yarn add cfn-template-stream
bun add cfn-template-stream
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-03-01 |
| First published | 2017-03-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+7 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Ben Drucker |
| Maintainers | bendrucker |
| Keywords | aws, cloudformation, cfn, template, json, yaml, yml, stream, read |

## Links

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

## Dependencies (3)

- [js-yaml](https://npm.io/package/js-yaml.md) ~3.8.1
- [JSONStream](https://npm.io/package/JSONStream.md) ~1.3.1
- [js-yaml-schema-cfn](https://npm.io/package/js-yaml-schema-cfn.md) ~1.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

- 1.0.0 (latest) — 2017-03-01

## README

# cfn-template-stream [![Build Status](https://travis-ci.org/bendrucker/cfn-template-stream.svg?branch=master)](https://travis-ci.org/bendrucker/cfn-template-stream)

> Streamingly read/parse/stringify CloudFormation templates


## Install

```
$ npm install --save cfn-template-stream
```


## Usage

```js
var cfnTemplate = require('cfn-template-stream')

cfnTemplate.fromFile('./my-template.yml')
  .pipe(ObjectTransform())
  .pipe(cfnTemplate.Stringify('.yml'))
  .pipe(fs.createWriteStream('./my-template-transformed.yml'))
```

## API

#### `template.Parse(extension)` -> `stream.Transform`

Returns a transform stream that receives template strings in the specified format and emits parsed template objects.

##### extension

*Required*  
Type: `string`

The file extension, either `.json` or `.yml`.

#### `template.fromFile(filename)` -> `stream.Readable`

Returns a readable stream that auto-detects the file type from the `filename` and pipes the data to `template.Parse`.

##### filename

*Required*  
Type: `string`

The path to a `.json` or `.yml` file.

#### `template.Stringify(extension)` -> `stream.Transform`

Returns a transform stream that receives template object chunks and emits template strings.

##### extension

*Required*  
Type: `string`

The file extension, either `.json` or `.yml`.


## License

MIT © [Ben Drucker](http://bendrucker.me)

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