A lexer, parser and writer for Valve's Data Format (VDF, KeyValues). Package vdf, module github.com/Rethunk-Tech/vdf/v2.
Parses Valve's Data Format (Steam's
libraryfolders.vdf, appmanifest_*.acf, game configs) into nested maps and writes such a map back
out. It is a fork of andygrunwald/vdf, created by Andy
Grunwald, which this repository keeps the history and MIT license of.
go get github.com/Rethunk-Tech/vdf/v2A worked example and the contracts: HUMANS.md.
NewParser(r).Parse()reads a document intomap[string]anyof strings and nested maps.Writerenders that map back out with sorted keys; parse, write, parse yields the same map.- Quoted and bare identifiers, escapes,
//comments and recursive duplicate-section merging (later scalars win; a later section or scalar replaces an earlier one of the other kind). - A scanner (
NewScanner) for callers that want tokens. - Fuzz targets for the scanner, parser and the write round trip.
| Doc | Audience |
|---|---|
| HUMANS.md | Running and using the package |
| AGENTS.md | Internals, invariants, and why |
| CONTRIBUTING.md | Process — commits, tests, docs |
| SECURITY.md | Vulnerability disclosure |
| CHANGELOG.md | Release notes |
MIT — see LICENSE. © 2016 Andy Grunwald, © 2026 Rethunk.Tech, LLC.