0

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. The drawback it has to write even the unchanged lines which just makes it really slow

Is it possible to edit a file with the cursor position like (x, y) just those bytes without rewriting the entire file in NodeJS?

Keerthi Vasan
  • 63
  • 1
  • 7
  • hi Keerthi Vasan, Welcome to SO. Please Read [How to ask a good question here](https://stackoverflow.com/help/how-to-ask)... – Krunal Shah Jan 13 '21 at 06:56
  • Does this answer your question? [Random access in node.js](https://stackoverflow.com/questions/24230135/random-access-in-node-js) – Vasyl Moskalov Jan 13 '21 at 09:25
  • No actually it doesn't, I want a package to write let's say 5th line and replace the 5th line alone instead of rewriting the whole file or maybe it's not possible to do that? – Keerthi Vasan Jan 14 '21 at 02:05

0 Answers0