write buffer to file in node
/*
Using nodejs' fs module you can create a WriteStream
to handle raw stream of bytes and buffers.
*/
const path = "path/to/the/file";
array = BigInt64Array(0);
buffer = Buffer.from(array.buffer)
fs.createWriteStream(path).write(buffer);
4.17
6
fs = require('fs');
fs.writeFile('helloworld.txt', 'Hello World!', function (err) {
if (err) return console.log(err);
console.log('Hello World > helloworld.txt');
});
Thank you!
6
0
Are there any code examples left?
New code examples in category Javascript