PackageTrack
Sign in Get early access

yaml_edit

A library for YAML manipulation with comment and whitespace preservation.

2.2.4 7.9M downloads/mo #69 most downloaded on pub.dev dart-lang/tools

What this package is like to depend on

Last release 6 months ago

13 Feb 2026

Ships fairly regularly

a new release about every 6 months

Nearly every release is documented

notes for 15 of 15 stable releases

Nothing withdrawn

no release was ever pulled

6 years old

15 releases · first in 2020

2 releases in the last 12 months

see the full history below

Release timeline

15 releases · Aug 2020 to Feb 2026
2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 15
  1. 2.2.4 13 Feb 2026
    Release notes
    • Removes comments associated with a node when remove is called.
      • v2.2.3 and earlier.

        ## Before edit
        ---
        key: value # These
              # dangling
                # should be
                  # removed.
        
        # Safe
        next:
          - value # These
                  # should be
                  # removed.
        
          # Safe
          - next
        
        # After edit:
        #   1. YamlEditor.remove(['key'])
        #   2. YamlEditor.remove(['next', 0])
        ---
              # dangling
                # should be
                  # removed.
        
        # Ignored
        next:
                  # should be
                  # removed.
        
          # Safe
          - next
        
      • v2.2.4 and later (same string as above)

        # After edit:
        #   1. YamlEditor.remove(['key'])
        #   2. YamlEditor.remove(['next', 0])
        ---
        # Ignored
        next:
          # Safe
          - next
        
    Open source →
  2. 2.2.3 02 Dec 2025
    Release notes
    • Fix alphabetical ordering when inserting into a single-element maps. (#2258)
    Open source →
  3. 2.2.2 20 Dec 2024
    Release notes
    • Suppress warnings previously printed to stdout when parsing YAML internally.

    • Fix error thrown when inserting duplicate keys to different maps in the same list. (#69)

    • Fix error thrown when inserting in nested list using spliceList method (#83)

    • Fix error thrown when string has spaces when applying ScalarStyle.FOLDED. (#41). Resolves ([#86]).

    • Require Dart 3.1

    • Move to dart-lang/tools monorepo.

    Open source →
  4. 2.2.1 02 May 2024
    Release notes
    • Require Dart 3.0
    • Fix removal of last key in blockmap when key has no value (#55).
    Open source →
  5. 2.2.0 21 Feb 2024
    Release notes
    • Fix inconsistent line endings when inserting maps into a document using \r\n. (#65)

    • AliasError is changed to AliasException and exposed in the public API.

      All node-mutating methods on YamlEditor, i.e. update(), appendToList(), prependToList(), insertIntoList(), spliceList(), remove() will now throw an exception instead of an error when encountering an alias on the path to modify.

      This allows catching and handling when this is happening.

    Open source →
  6. 2.1.1 02 May 2023
    Release notes
    • Require Dart 2.19
    Open source →
  7. 2.1.0 02 Mar 2023
    Release notes
    • Breaking wrapAsYamlNode(value, collectionStyle, scalarStyle) will apply collectionStyle and scalarStyle recursively when wrapping a children of Map and List. While this may change the style of the YAML documents written by applications that rely on the old behavior, such YAML documents should still be valid. Hence, we hope it is reasonable to make this change in a minor release.
    • Fix for cases that can't be encoded correctly with scalarStyle: ScalarStyle.SINGLE_QUOTED.
    • Fix YamlEditor appendToList and insertIntoList functions inserts new item into next yaml item rather than at end of list. (#23)
    Open source →
  8. 2.0.3 12 May 2022
    Release notes
    • Updated the value of the pubspec repository field.
    Open source →
  9. 2.0.2 17 Mar 2022
    Release notes
    • Fix trailing whitespace after adding new key with block-value to map (#15).
    • Updated repository and other meta-data in pubspec.yaml.
    Open source →
  10. 2.0.1 27 Sep 2021
    Release notes
    • License changed to BSD, as this package is now maintained by the Dart team.
    • Fixed minor lints.
    Open source →
  11. 2.0.0 28 Apr 2021
    Release notes
    • Migrated to null-safety.
    • API will no-longer return null in-place of a YamlNode, instead a YamlNode with YamlNode.value == null should be used. These are easily created with wrapAsYamlNode(null).
    Open source →
  12. 1.0.3 02 Nov 2020
    Release notes
    • Fixed bug in adding an empty map as a map value.
    Open source →
  13. 1.0.2 01 Sep 2020
    Release notes
    • Throws an error if the final YAML after edit is not parsable.
    • Fixed bug in adding to empty map values, when it is followed by other content.
    Open source →
  14. 1.0.1 25 Aug 2020
    Release notes
    • Updated behavior surrounding list and map removal.
    • Fixed bug in dealing with empty values.
    Open source →
  15. 1.0.0 07 Aug 2020
    Release notes
    • Initial release.
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive