parseck2
v1.0.4
Published
Parse a Crusader Kings II saved game file into a usable JavaScript object.
Downloads
10
Maintainers
Readme
parseck2
Parse a Crusader Kings II save game file into a JSON object.
parseck2
will parse an uncompressed Crusader Kings II save game file into a usable JSON object with the game data. Save game files can be quite large. The resulting JSON is slightly larger still, so parsing and transforming this data does take a bit of time, on the order of a few minutes.
I owe a great deal to Chris Kjær's ck2parser project, as well as PEG.js, which generated the script that first parses the save game file to JSON. This first pass is a bit rough, so this package also uses a transformer to make the JSON more useful.
Installation
You can install with npm
:
$ npm install parseck2 --save
How to Use
To use parseck2
in your own scripts, first require it:
To compile your native addon, first go to its root directory:
var ck2parse = require('ck2parse');
Then call it as a function, passing the path of the file you'd like to parse as a parameter. It will return the JSON object.
var data = ck2parse("/path/to/ck2/autosave.ck2");
License
Creative Commons Attribution Share-Alike 4.0 International License