Re: Saving data in custom moduleã By: Sam Alexander to All on Fri Mar 25 2022 15:13:06ãã SA> I'm probably overlooking this in the docs, but if I'm building a customã SA> module how can I save data back to the Synchronet database or elsewhere?ã SA> I'm still really foggy in how Sync saves data to the file system. I'mã SA> playing with some ideas for custom modules which will need to save dataã SA> back, just not sure how to do this. ããThere are a lot of different ways. Synchronet and its modules don't store all of their data in any one place following any one format.ããThe exec/load/userprops.js library lets you set per-user keys and values arbitrarily.ããThe built-in File class lets you do typical file IO stuff. It's documented in jsobjs.html* and there are many usage examples in exec/. Create your own file wherever you like and put whatever you want in it. You can use it with ini files and with JSON.parse/JSON.stringify if you like.ããThere's the JSON-DB service, which lets you share a JS object among multiple clients including remote BBSs. Has a subscription feature so it'll push real-time updates to clients.ããThe user, message, and file databases can all be interacted with from JS. See the User class, the MsgBase class, the FileBase class in jsobjs.html*.ãã*
https://synchro.net/docs/jsobjs.htmlã ã--- ãechicken ãelectronic chicken bbs - bbs.electronicchicken.comã---ã þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.comã