No description
Find a file
Kirill Zhumarin c367a3972c RTF support
2024-05-06 14:05:00 +03:00
.github/workflows fix publish 2024-05-05 23:58:32 +03:00
examples fix package.json + examples 2024-05-06 00:07:13 +03:00
src RTF support 2024-05-06 14:05:00 +03:00
.editorconfig first commit 2024-05-01 13:51:44 +03:00
.gitignore first commit 2024-05-01 13:51:44 +03:00
.prettierrc.json first commit 2024-05-01 13:51:44 +03:00
jest.config.js jest config 2024-05-05 23:11:29 +03:00
LICENSE first commit 2024-05-01 13:51:44 +03:00
package-lock.json RTF support 2024-05-06 14:05:00 +03:00
package.json RTF support 2024-05-06 14:05:00 +03:00
README.md parser 2.0 2024-05-05 23:09:19 +03:00

NPM Version

SUMMARY

Parser and utils for the .VKP files format which is used in the V-Klay.

INSTALL

npm i @sie-js/vkp

USAGE

import fs from 'fs';
import { vkpNormalize, vkpParse } from '@sie-js/vkp';

// Convert from windows-1251 to UTF-8 + replace CRLF to LF
let patchText = vkpNormalize(fs.readFileSync('../patches/patches/E71v45/10732-ElfPack-18_03_2024-v3_2_2.vkp'));

// Parse patch
let vkp = vkpParse(patchText);
console.dir(vkp, { depth: null });

if (vkp.warnings.length || vkp.errors.length) {
    for (let warn of vkp.warnings) {
        console.log(`Warning: ${warn.message}`);
        console.log("```");
        console.log(warn.codeFrame(patchText));
        console.log("```");
        console.log("");
    }

    for (let err of vkp.errors) {
        console.log(`Error: ${err.message}`);
        console.log("```");
        console.log(err.codeFrame(patchText));
        console.log("```");
        console.log("");
    }

    console.log("");
}