I'm trying to add a first line to an existing text file using node.js.
My actual code looks as follows: var fs = require('fs');
fs.appendFile('test.txt', 'X Y', function (err) {
});
The text: 'X Y' is not added as first line, but last.
It would help a lot, if you have an idea, how to add my line as first of the document! :-)
Greetings, JS