• This method exists as a separate function so it can be used by ConfigFile OR outside of ConfigFile.

    Parameters

    • filePath: string

      where to save the file

    Returns Promise<LockInitResponse>

    2 functions:

    • writeAndUnlock: a function that takes the data to write and writes it to the file, then unlocks the file whether write succeeded or not
    • unlock: a function that unlocks the file (in case you don't end up calling writeAndUnlock)