yamltools

1.0.2 • Public • Published

YAMLtools

ci

parseWithComments

This function takes a YAML string and an optional commentProperty, which defaults to $comment.

Comments in the YAML string are preserved in the JSON object using the commentProperty name.

stringifyWithComments

This function takes a JSON object and an optional commentProperty, which defaults to $comment.

Properties in the JSON object with the name of the commentProperty are stringified as YAML comments.

parseWithAliases

This function returns an object with a data property containing the parsed object, and an aliases property containing a Map of YAML aliases to their object representations.

Limitations

Because JSON objects cannot contain duplicate keys, comments may get concatenated when parsing.

Comments are not guaranteed to be attached to the same node when roundtripping.

Package Sidebar

Install

npm i yamltools

Weekly Downloads

1

Version

1.0.2

License

BSD-3-Clause

Unpacked Size

19.5 kB

Total Files

14

Last publish

Collaborators

  • mermade