pub package

An encoder and decoder for Valve's KeyValue format (VDF).

Usage

A VdfCodec encodes input json using Valve's KeyValue format (VDF) and decodes KeyValue string to json.

The vdf is the default implementation of VdfCodec.

Example:

var encoded = vdf.encode({"sampleData":{"foo":"bar"}});

var decoded = vdf.decode(r'''
"sampleData"
{
	"foo"		"bar"
}
''');

You can use shorthands vdfEncode and vdfDecode. Useful if a local variable shadows the global vdf constant:

var encoded = vdfEncode({"sampleData":{"foo":"bar"}});

var decoded = vdfDecode(r'''
"sampleData"
{
	"foo"		"bar"
}
''');

For more information, see also VdfEncoder and VdfDecoder.

Libraries

vdf