Modify a file if it exists or create a new one if it doesn't using fs.createWriteStream() flags?

I am receiving chunked files from the client application in my node app. Different chunks come in separate requests. Then I assemble the chunks into a whole file on the server by writing to a single file using write streams with padding.

The problem I have is that when I write the first chunk I need to create the file, and for all following chunks I only need to modify that file. To achieve this I use fs.createWriteStream(filePath) - this will rewrite the file every time I call it, so I need to pass special flag: r+. The problem with this flag is that it only works with already existing file, and throws an error if can't find it.

So I want to know is if there is any flag that will force fs to create a file if it does not exist or update existing file without explicitly calling fs.exists

Here is what I came up with for the moment:

//check if file exists
fs.exists(filePath, function(exists) {
    //if it does exist, then modify it
    if (exists) {
        flags = 'r+';
    //else create a new one
    } else {
        flags = 'w';
    }

    var ws = fs.createWriteStream(filePath, {
        start: chunkInfo.chunkNumber * chunkInfo.chunkSize, //set chunk padding
        flags: flags
    });

    file.pipe(ws); //pipe the file read stream to write stream
});