I found an answer of at this github repository https://github.com/leon/labs-chrome-file-write
I just needed to add {create:true} as a parameter when searching for a file in the directory