Static
JSONStringifyStatic
ParseParses two buffers (main blueprint file + config file) into a object
the name of the blueprint, since it is not part of the binary data and has to be passed.
the main blueprint file ".sbp"
the config blueprint file ".sbpcfg"
Optional
options: Partial<{ provides callbacks. onDecompressedBlueprintBody gets called when the body of the main blueprint file is decompressed.
Static
ParseParses a given binary buffer as SatisfactorySave
the save name. It won't be serialized, so it does not matter how you name it.
the actual binary buffer
Optional
options: Partial<{ provides callbacks. Either on the decompressed save body or on reported progress as a number [0,1] with an occasional message.
Static
WriteWrites a Blueprint object to binary. And reports back on individual callbacks.
the blueprint to be written
Optional
options: Partial<{ onMainFileBinaryBeforeCompressing gets called back when the main blueprint file binary is ready before compressing. onMainFileHeader gets called back when the main blueprint file header is ready. onMainFileChunk gets called back when a main blueprint file chunk is ready.
a chunk summary of the main file generated chunks. Plus the binary data of the config file, since it is often very small.
Static
Writeserializes a SatisfactorySave into binary and reports back on individual callbacks.
the SatisfactorySave to serialize into binary.
Optional
options: Partial<{ provides callbacks. onBinaryBeforeCompressing gets called on the binary save body before it is compressed. onHeader gets called on the binary save header, which is always uncompressed. onChunk gets called when a chunk of the compressed save body was generated. Often, files' save bodies consist of multiple chunks.
a summary of the generated chunks.
It JSON.stringifies any parsed content safely. The original JSON.stringify() has some flaws that get in the way, so it is custom wrapped. The original has some problems: