@save-ward/save-parser-skyrim
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

@save-ward/save-parser-skyrim

SaveWard parser for "The Elder Scrolls V: Skyrim" save files. N.B.: it does not support the "Special Edition" version of the game.

Usage

To parse a Skyrim save file (has the .ess extension), read it into a binary Buffer, instantiate a new SaveParserSkyrim object with this buffer and call the parse() method. Here is a minimal example:

const fs = require('fs');

const { SaveParserSkyrim } = require('@save-ward/save-parser-skyrim');

fs.readFile('save.ess', (err, buffer) => {
    const parser = new SaveParserSkyrim(buffer);
    const metadata = parser.parse();
    console.log(metadata);
});

/*
    Outputs:
    {
        "valid": true,
        "playerName": "Prisoner",
        "playerLevel": 1,
        "playerLocation": "Skyrim",
        ...
    }
*/

Returned Metadata

This parser returns the following metadata:

interface ISkyrimSaveMetadata {
    playerName: string; // player character name
    playerLevel: number; // player character level
    playerLocation: string; // player character in-game location name
    playerCurrentExp: number; // player character current experience
    playerLevelUpExp: number; // player character total needed experience to level up
    gameDate: string; // current in-game date
    screenshot: ImageMetadata; // screenshot associated with the save
    pluginsList: string[]; // names of plugins (.esm and .esp) that were loaded during the game
}

interface ImageMetadata {
    // width and height are specified in pixels
    getWidth(): number;
    getHeight(): number;

    // image buffer is an RGB buffer (24 bits per pixel)
    getImage(): Buffer;
}

Contributing

Contributing instructions are included in the root of the monorepo, but please remember to test the changes you make.

License

The GPLv3 license is used for this project.

Readme

Keywords

Package Sidebar

Install

npm i @save-ward/save-parser-skyrim

Weekly Downloads

4

Version

1.1.0

License

GPL-3.0-or-later

Unpacked Size

43.9 kB

Total Files

5

Last publish

Collaborators

  • vpukhanov