I
I
ince2019-09-16 23:09:46
Node.js
ince, 2019-09-16 23:09:46

How to append to a file?

How to add data to json (ndjson) without reading it (I have it big)?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
RidgeA, 2019-09-16
@ince

you can simply add to the file by simply opening it with the necessary flags - https://nodejs.org/dist/latest-v12.x/docs/api/fs.h...
another question is that the file has a certain format and simply taking and adding to the end of the file it can be broken

I
Ivan Shumov, 2019-09-16
@inoise

No way. Might be worth considering adding a database to the project

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question