Open btimby opened 3 years ago
Create a new npm package that encapsulates the PrefixedStorage class as well as the node / browser compatibility here. This could be a good standalone library and is not specific to this project.
https://github.com/btimby/ug/blob/master/src/engine/storage.js
Node / browser compatibility is achieved by using dom-storage under node, which is a localStorage-like interface that saves to a json file.
dom-storage
localStorage
https://github.com/btimby/ug/blob/master/src/index.js#L419
Create a new npm package that encapsulates the PrefixedStorage class as well as the node / browser compatibility here. This could be a good standalone library and is not specific to this project.
https://github.com/btimby/ug/blob/master/src/engine/storage.js
Node / browser compatibility is achieved by using
dom-storage
under node, which is alocalStorage
-like interface that saves to a json file.https://github.com/btimby/ug/blob/master/src/index.js#L419