fs.writeSync instead of fs.write

Made to master because couldn't find fsx.js file in other branches.