Right now I use readStream, and then do some modifications and then write the processed line into a .tmp file. After writing is done it is renamed to the original file name.