Last active
July 17, 2024 23:36
-
-
Save bberak/4ab2abee49e5f3e7be3143415e52bae5 to your computer and use it in GitHub Desktop.
Write a binary buffer to file using NodeJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require("fs"); | |
const kb = 32 * 1024; | |
const buf = Buffer.alloc(kb); | |
const ws = fs.createWriteStream("out.bin") | |
buf.fill(0xEA) | |
ws.write(buf); | |
ws.end(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment