js-yaml schema that adds CloudFormation custom YAML tags (!Ref, !Sub, !GetAtt, !If, etc.) enabling standard YAML parsers to handle CloudFormation templates. Current stable version 2.0.2, maintained since 2018, with low release cadence. It transforms tags into plain objects (e.g., !Ref logicalId -> {Ref: logicalId}) mimicking the long-form syntax. Differentiator: lightweight, no additional dependencies beyond js-yaml peer dep, and supports all core CloudFormation intrinsic functions.
npm install cloudformation-schema-js-yamlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Read a CloudFormation YAML file and parse it using js-yaml with the custom schema, outputting the resulting object as JSON.
Update code to use yaml.load() instead of yaml.safeLoad().
Use yaml.load(content, { schema }) instead of yaml.safeLoad(content, { schema }).Ensure tags are represented as YAML tags, not embedded in strings.
Use yaml.load(content, { schema, uniqueKeys: false }) to allow duplicate keys.Create a declaration file: declare module 'cloudformation-schema-js-yaml' { const schema: any; export default schema; }Pass the schema option: yaml.load(content, { schema: require('cloudformation-schema-js-yaml') }).Use correct import: const schema = require('cloudformation-schema-js-yaml');Run 'npm install cloudformation-schema-js-yaml' and also ensure js-yaml is installed ('npm install js-yaml').