No description
Find a file
Kirill Zhumarin 02edc7f073 2.0.1
2025-04-13 23:55:58 +03:00
.github/workflows CI 2025-04-13 21:34:12 +03:00
docs npm -> pnpm, js -> ts 2025-04-13 14:44:21 +03:00
examples update examples 2025-04-13 21:32:24 +03:00
src improve types 2025-04-13 16:46:27 +03:00
.editorconfig CI 2025-04-13 21:34:12 +03:00
.gitignore js -> ts 2025-04-13 16:32:48 +03:00
LICENSE first commit 2024-05-01 13:51:44 +03:00
package.json 2.0.1 2025-04-13 23:55:58 +03:00
pnpm-lock.yaml js -> ts 2025-04-13 16:32:48 +03:00
README.md npm -> pnpm, js -> ts 2025-04-13 14:44:21 +03:00
tsconfig.json js -> ts 2025-04-13 16:32:48 +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
const patchText = vkpNormalize(fs.readFileSync('../patches/patches/E71v45/10732-ElfPack-18_03_2024-v3_2_2.vkp'));

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

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

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

    console.log("");
}