@sourcelib/kv
v0.7.1
Published
Source Engine KeyValue file parser and tokenizer library
Downloads
6
Readme
@sourcelib/kv
Typescript library to tokenize, parse, inspect, analyse, reformat and do other language integrations for source engine keyvalue files.
Installation
npm install @sourcelib/kv
Usage
import { tokenize, parse } from '@sourcelib/kv';
const tokens = tokenize(`
"KV" {
"key" "value"
"key2" "value2"
}`);
const kvTree = parse(tokens);
kvTree.getChildren()[0].getValues()[0].getValue(); // "value"