1.1.0 • Published 5 years ago

@save-ward/save-parser-skyrim v1.1.0

Weekly downloads
4
License
GPL-3.0-or-later
Repository
github
Last release
5 years ago

@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.