Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bluelovers/node-ck2
GFX game configuration format parser. Crusader Kings II | Paradox Interactive
https://github.com/bluelovers/node-ck2
config configuration crusader-kings-ii game gfx paradox-interactive
Last synced: 3 days ago
JSON representation
GFX game configuration format parser. Crusader Kings II | Paradox Interactive
- Host: GitHub
- URL: https://github.com/bluelovers/node-ck2
- Owner: bluelovers
- Created: 2017-03-01T07:57:35.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-28T07:49:01.000Z (about 6 years ago)
- Last Synced: 2024-10-28T07:44:46.377Z (16 days ago)
- Topics: config, configuration, crusader-kings-ii, game, gfx, paradox-interactive
- Language: JavaScript
- Size: 54.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# node-ck2
GFX game configuration format parser. Crusader Kings II | Paradox Interactive
`npm install ck2`
this version is very stupid and slow, wellcome rewrite code
```typescript
const ck2 = require('ck2');
const assert = require('assert');let options = {
//pretty: false,
comment: false,
pretty: true,
//pretty: false,
print_length: 50,
};let input = `
##########remedy_fe_swapping6##########
fe131 = { random = no customizer = no hidden = yes } #辛格尔德
fe132 = { random = no customizer = no hidden = yes } #艾丝琳
fe133 = { random = no customizer = no hidden = yes } #亚斯穆尔
fe134 = { random = no customizer = no hidden = yes } #克尔特
fe135 = { random = no customizer = no hidden = yes } #拜隆
fe136 = { random = no customizer = no hidden = yes } #林格
fe137 = { random = no customizer = no hidden = yes } #雷普托尔
fe138 = { random = no customizer = no hidden = yes } #兰格巴鲁特loputousu = {
graphical_culture = westerngfx
graphical_unit_culture = western
color = { 1.0 0.0 0.0 }
# ?222 ?254 ?208 ?240 ?
}
`;let data = ck2.parse(input, options);
let output = ck2.stringify(data, options);
let data2 = ck2.parse(output, options);console.log(data);
assert.deepEqual(data, data2);
```