Closed ralyodio closed 8 years ago
Is it possible with this module?
I have a lot of asynchronous tasks that all write JSON to the same file in parallel. I will often get a corrupted file because two functions write to the file at the same time.
Is there anyway to avoid this using lockfile?
lockfile
Yes! Create a lock file whose file name is deterministicly generated from the json file name. You may also like http://npm.in/write-file-atomic
Can you provide an example?
also that link doesn't go anywhere.
Is it possible with this module?
I have a lot of asynchronous tasks that all write JSON to the same file in parallel. I will often get a corrupted file because two functions write to the file at the same time.
Is there anyway to avoid this using
lockfile
?