I have a several processes node.js. I want to only add one string to one file in each request ( like log file in nginx, apache, etc ). What is the best way do it ? Simple:
fs.open(file, "a", 0744, function (err, fd) {
if (err) throw err;
fs.write(fd, data, null, 'utf8', function (err, written) {
if (err) throw err;
});
});
or else ?