How to save ArrayBuffer?

后端 未结 3 1875
北恋
北恋 2020-12-22 07:56

How to save an ArrayBuffer in json file? I use electron-config for this, but in config.json I found \"{}\". I try convert (code) ArrayBuffer to string, but then I can\'t con

3条回答
  •  情话喂你
    2020-12-22 08:32

    For saving to disk, you should be able to use the normal node APIs for writing something to disk. For example:

    require('fs').writeFileSync('/path/to/saved/file', Buffer.from(myArrayBuffer));
    

提交回复
热议问题