
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
cloudformation-schema-js-yaml
Advanced tools
js-yaml Schema for handling Cloudformation's custom classes
Cloudformation supports custom yaml classes, e.g. !Ref
, !Sub
, !If
, etc.
Yaml parsers will choke on these custom classes unless the classes are specified.
Use this library with js-yaml
to parse cloudformation templates with these classes. The cloudformation classes are converted into objects that are similar to the non custom class syntax e.g. Ref
, Fn::Sub
, Fn::If
const yaml = require('js-yaml');
const schema = require('cloudformation-schema-js-yaml');
const fs = require('fs');
let file = fs.readFileSync('somefile.yaml');
let data = yaml.load(file, { schema: schema});
sample.yaml
test:
- !Ref someLogicalId
- !Sub A string with a substitution ${someLogicalId}
Program extract
let file = fs.readFileSync('sample.yaml');
let data = yaml.load(file, { schema: schema});
console.log(data)
console.log('%j', data)
Output
{ test:
[ Obj { Ref: 'someLogicalId' },
Obj { 'Fn::Sub': 'A string with a substitution ${someLogicalId}' } ] }
{"test":[{"Ref":"someLogicalId"},{"Fn::Sub":"A string with a substitution ${someLogicalId}"}]}
None
This this library is meant to be used with js-yaml it has a peer dependency of js-yaml
npm test
FAQs
js-yaml Schema for handling Cloudformation's custom classes
The npm package cloudformation-schema-js-yaml receives a total of 309 weekly downloads. As such, cloudformation-schema-js-yaml popularity was classified as not popular.
We found that cloudformation-schema-js-yaml demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.