I'm trying to write a set of unified methods to handle save data using either LocalStorage (for preview and a possible web release) or NWjs (for the desktop release). I'm having trouble getting the former to work, and I wonder if it's because LocalStorage is async while NWjs uses synchronous read/writes.
Anyway, I'd like to write a JS method to call the correct storage handler internally in one method. Is it possible to access the NWjs object type and its methods (specifically create folder, write to file, and ReadFile) from the JS API? I examined runtime.objects.NWjs.getFirstInstance() and didn't find anything helpful on there.
Edit: I know I can just make a C3 function that returns the value of NWjs.ReadFile() and call that from JS. I just wonder if there's a more direct approach.
Edit 2: While I'm asking API questions, can I check the "System | Is in preview" property from JS too?