<Buffer> | <URL> | <integer> filename or file descriptor • data <string> | <Buffer> | <TypedArray> | <DataView> | <Object> • options <Object> | <string> ◦ encoding <string> | <null> Default: 'utf8' ◦ mode <integer> Default: 0o666 ◦ flag <string> See support of file system flags. Default: 'w'. Returns undefined . If data is a plain object, it must have an own (not inherited) toString function property. The mode option only affects the newly created file. See fs.open() for more details. For detailed information, see the documentation of the asynchronous version of this API: fs.writeFile() .