Do you have an idea how will I do theline of code below in node JS?
const file = new File([Data], `${filename}.card`, { type: 'application/octet-stream', lastModified: Date.now() });
Thanks.
You can use the writeFileSync()
method from the file system API to write to a file in Nodejs:
/*
Example of data being transformed into a buffer suitable for writing
to file:
const Data = [ 0, 1, 2, 3 ];
const buffer = Buffer.from(Data);
*/
fs.writeFileSync(`${filename}.card`, buffer)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With