Skip to content

interface.html: No Util.writeStorageJSON? #7758

Discussion options

You must be logged in to vote

Yes, you're right, there is no writeStorageJSON - I guess we could add one...

But as you suggest:

Util.writeStorage(filename, JSON.stringify(data), callback)

Is totally fine to do - the reason we have Util.readStorageJSON is that when writing JSON to files Bangle.js writes a more relaxed, memory-efficient format (eg {a:1,b:2} rather than {"a":1,"b":2} and just using JSON.parse (eg reading rather than writing) wouldn't work.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ticalc-travis
Comment options

Answer selected by ticalc-travis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants