Method description:
The function of this method is similar to fs.appendFile(). The only difference is that this method uses synchronous operation, while fs.appendFile uses asynchronous operation.
Grammar:
Since this method belongs to the fs module, the fs module needs to be introduced before use (var fs = require(“fs”) )
Receive parameters:
1. filename {String}
2. data {String | Buffer}
3. options {Object}
encoding {String | Null} default = ‘utf8′
mode {Number} default = 438 (aka 0666 in Octal)
flag {String} default = ‘a’
Source code: