-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
asyncOnWrite operations should return a Promise #8
Comments
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. This is how apps with file-based DBs like MSWord, etc do it to prevent corruption. 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: #18. |
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.
The text was updated successfully, but these errors were encountered: