1.0.0 • Published 7 years ago
cfn-template-stream v1.0.0
cfn-template-stream
Streamingly read/parse/stringify CloudFormation templates
Install
$ npm install --save cfn-template-stream
Usage
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
1.0.0
7 years ago