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 2026Releases
latest 15-
2.2.413 Feb 2026Release notes
Open source →- Removes comments associated with a node when
removeis called.-
v2.2.3and 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.4and later (same string as above)# After edit: # 1. YamlEditor.remove(['key']) # 2. YamlEditor.remove(['next', 0]) --- # Ignored next: # Safe - next
-
- Removes comments associated with a node when
-
2.2.302 Dec 2025Release notes
Open source →- Fix alphabetical ordering when inserting into a single-element maps. (#2258)
-
2.2.220 Dec 2024Release notes
Open source →-
Suppress warnings previously printed to
stdoutwhen 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
spliceListmethod (#83) -
Fix error thrown when string has spaces when applying
ScalarStyle.FOLDED. (#41). Resolves ([#86]). -
Require Dart 3.1
-
Move to
dart-lang/toolsmonorepo.
-
-
2.2.102 May 2024Release notes
Open source →- Require Dart 3.0
- Fix removal of last key in blockmap when key has no value (#55).
-
2.2.021 Feb 2024Release notes
Open source →-
Fix inconsistent line endings when inserting maps into a document using
\r\n. (#65) -
AliasErroris changed toAliasExceptionand 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.
-
-
2.1.102 May 2023 -
2.1.002 Mar 2023Release notes
Open source →- Breaking
wrapAsYamlNode(value, collectionStyle, scalarStyle)will applycollectionStyleandscalarStylerecursively when wrapping a children ofMapandList. 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
appendToListandinsertIntoListfunctions inserts new item into next yaml item rather than at end of list. (#23)
- Breaking
-
2.0.312 May 2022 -
2.0.217 Mar 2022Release notes
Open source →- Fix trailing whitespace after adding new key with block-value to map (#15).
- Updated
repositoryand other meta-data inpubspec.yaml.
-
2.0.127 Sep 2021Release notes
Open source →- License changed to BSD, as this package is now maintained by the Dart team.
- Fixed minor lints.
-
2.0.028 Apr 2021Release notes
Open source →- Migrated to null-safety.
- API will no-longer return
nullin-place of aYamlNode, instead aYamlNodewithYamlNode.value == nullshould be used. These are easily created withwrapAsYamlNode(null).
-
1.0.302 Nov 2020 -
1.0.201 Sep 2020Release notes
Open source →- 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.
-
1.0.125 Aug 2020Release notes
Open source →- Updated behavior surrounding list and map removal.
- Fixed bug in dealing with empty values.
-
1.0.007 Aug 2020