jprichardson / node-jsonfile

Easily read/write JSON files.
MIT License
1.2k stars 321 forks source link

Add Atomic Write Methods #108

Closed jaruba closed 6 years ago

jaruba commented 6 years ago

Implemented atomic save methods, as per the discussion from: https://github.com/nathanbuchar/electron-settings/issues/110

RyanZim commented 6 years ago

This seems like a specialized use-case, not broad enough to warrant adding a dependency to jsonfile for. Also, this could be a breaking change since it'd be creating temp files. @jprichardson?

jprichardson commented 6 years ago

@RyanZim agreed.

This could be a separate package: atomic-jsonfile or something like that.

wilburforce83 commented 5 years ago

what happened to this? I am having problems with power outages causing users to lose saved data. Is there a way to implement this? thanks

jaruba commented 5 years ago

@wilburforce83 your welcome to use my fork which has atomic save implemented, if you want:

https://github.com/jaruba/node-jsonfile