added functionality, tests, and example for temp.write (fs.writeFile)