asyncOnWrite operations should return a Promise
As it is, there doesn't seem to be a hook that lets the program know that writing is done, and as a result my database is randomly corrupted on program exit (in the middle of a write operation). Promise wrapper seems the most obvious way to handle this, but we need SOMETHING.
If your concurrency model requires stronger guarantees I'd suggest you to move to a proper storage method instead of hardening this old toy JSON wrapper. Anyway, PRs are always welcome.
It's not hard to roll your own json file disk storage honestly. For starters, if you want to keep your data safe, all saving should happen to a different temp file and then, after success, replace main json file with temp file.
This is how apps with file-based DBs like MSWord, etc do it to prevent corruption. I do not know if this lib works that way.
My point is, don't depend so much on toy libraries like these with limited safeties and overly simplistic implementations. These things are easy to implement by yourself using core node.
No, it doesn't...but honestly, I think adding Promises would be nice.
Maybe you could submit a PR.
I added a PR including this enhancement: https://github.com/nmaggioni/Simple-JSONdb/pull/18.