December 2017
Intermediate to advanced
498 pages
11h 54m
English
The fs.writeFile(path, data, [options], callback) method writes the contents of data to the file at path. The data argument can be either a buffer or a string. The following options are available:
Usage is straightforward:
fs.writeFile('test.txt', 'A string or Buffer of data', err => { if (err) { return console.log(err); } // File has been written });
Read now
Unlock full access