@etothepii/satisfactory-file-parser 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,10 +29,25 @@ const parsedSave = SaveParser.ParseSaveFile(file);
|
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
Consequently, writing a parsed save file back is just as easy.
|
|
32
|
+
The SaveParser has callbacks to assist in syncing on different occasions during the process.
|
|
33
|
+
For example, when writing the header or when writing a chunk of the save body.
|
|
34
|
+
The splitting in individual chunks enables you to more easily stream the binary data to somewhere else.
|
|
32
35
|
```js
|
|
33
36
|
import { SaveParser } from "@etothepii/satisfactory-file-parser";
|
|
34
37
|
|
|
35
|
-
|
|
38
|
+
let header, bodyChunks;
|
|
39
|
+
SaveParser.WriteSave(save, binaryBeforeCompressed => {}, header => {
|
|
40
|
+
console.log('on save header.');
|
|
41
|
+
header = header;
|
|
42
|
+
}, chunk => {
|
|
43
|
+
console.log('on save body chunk.');
|
|
44
|
+
bodyChunks.push(chunk);
|
|
45
|
+
}, summary => {
|
|
46
|
+
console.log('finished writing chunks.');
|
|
47
|
+
|
|
48
|
+
// write complete sav file back to disk
|
|
49
|
+
fs.writeFileSync('./MyModifiedSave.sav', Buffer.concat([header, ...bodyChunks]));
|
|
50
|
+
});
|
|
36
51
|
```
|
|
37
52
|
|
|
38
53
|
## License
|
package/package.json
CHANGED