VDF is a module to convert Valve's KeyValue format to JSON and back using Typescript.
Installation
You can install VDF through the command line by using the following command:
yarn add @node-steam/vdf
Usage:
import * as VDF from '@node-steam/vdf';
import {
parse,
stringify,
} from '@node-steam/vdf';
Documentation:
Generated Documentation
VDF.parse(text: string)
Parse a VDF string into a JSON object
const string = `
"description" "This is a example VDF object!"
"boolean" "true"
"number" "529"
`;
const object = VDF.parse(string);
const object = parse(string);
> {
description: 'This is a example VDF object!',
boolean: 'true',
number: '529',
};
VDF.stringify(object: object)
Parse a JSON object into a VDF string
const object = {
description: 'This is a example VDF object!',
boolean: true,
number: 529,
};
const string = VDF.stringify(object);
const string = stringify(object);
> `
"description" "This is a example VDF object!"
"boolean" "true"
"number" "529"
`;
Contributors
Contributing:
Interested in contributing to VDF? Contributions are welcome, and are accepted via pull requests. Please review these guidelines before submitting any pull requests.
Help:
Installing dependencies:
yarn
Compile:
yarn compile
Test:
yarn test
Generate Docs:
yarn docs
Tests:
This module is thoroughly tested with ava
License:
Code licensed under MIT, documentation under CC BY 3.0.