views:

21

answers:

1

Current documentation here doesn't seem to mention any parameters governing the stream's behaviour with regards to whether file is re-created every time or just gets data appended.

Is there a way to create a writeStream which appends the data?

+1  A: 

There is a createWriteStream method right below it.

fs.createWriteStream(path, [options]) Returns a new WriteStream object (See Writable Stream).

options is an object with the following defaults:

{ 'flags': 'w'
, 'encoding': null
, 'mode': 0666
}

EDIT: The hash string doesn't seem to scroll to that point. Just go to the same link you gave, and read down a couple of lines.

Corey Hart
flags: 'a' does it. I with the doc was clear on what are the flags available.
Art