Created
October 11, 2023 07:45
-
-
Save michaelwittig/43e65bbc23cb1079fe8826af3c93c26c to your computer and use it in GitHub Desktop.
Diff two CloudFormation YAML templates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// dependencies | |
// npm i yaml-cfn | |
// npm i jest-diff | |
// usage: node cfn-template-diff.js a.yaml b.yaml | |
const {yamlParse} = require('yaml-cfn'); | |
const {readFileSync} = require('node:fs'); | |
const {diff} = require('jest-diff'); | |
const fileA = process.argv[2]; | |
const fileB = process.argv[3]; | |
const a = yamlParse(readFileSync(fileA)); | |
const b = yamlParse(readFileSync(fileB)); | |
console.log(diff(a, b)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment