json-fs-query
    Preparing search index...

    Function writeAtomically

    • Write text to location so that the file is always either its old or its new content, never half of one: the text goes to a temporary file next to it, which then replaces it (a rename is atomic within one folder). That holds when the process stops part way (a crash, a kill); there's no fsync, so after a power cut the file system may still lose a recent write. When the write or rename fails, the temporary file is removed and the original error thrown.

      Parameters

      • location: string
      • text: string

      Returns Promise<void>