0.5.3 • Published 4 years ago

key-values-ts v0.5.3

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

KeyValues.ts

npm package npm downloads CI status Codecov coverage License

A JavaScript/TypeScript parser for the KeyValues data format. KeyValues is an easy-to-use, JSON-like format developed by Valve Corporation. It is used in Steamworks configuration files as well as in several of Valve's games, such as Dota 2.

Installation

Using yarn:

yarn add key-values-ts

Using npm:

npm install key-values-ts

Usage

import KeyValues from 'key-values-ts';

const input = `"key"
{
  "key 1"  "value 1"
  "key 2"  "value 2"
}`;

// Convert the KeyValues text to an object:
const obj = KeyValues.parse(input);
// {
//   key: {
//     'key 1': 'value 1',
//     'key 2': 'value 2'
//   }
// }

// Convert the object back to a KeyValues text:
const output = KeyValues.stringify(obj);
// "key"
// {
//   "key 1"  "value 1"
//   "key 2"  "value 2"
// }
0.5.3

4 years ago

0.5.2

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago