instead of using a writable file stream, build up a string and write it synchronously to a file when using node.