Files
klz-cables.com/.pnpm-store/v10/files/13/b95fb6b39ebc233fff693dc119b5453836a15e28f6cbb353bad143ac56b2caaf62719ad0ed76433e1ac5d373ce7ae802bfbf244a90092bf946a18f00d71830
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

19 lines
613 B
Plaintext

import fs from 'fs/promises';
import { Readable } from 'stream';
/**
* Save buffer data to a file.
* @param {Buffer} buffer - buffer to save to a file.
* @param {string} filePath - path to a file.
*/ export const saveBufferToFile = async (buffer, filePath)=>{
// Setup readable stream from buffer.
let streamData = buffer;
const readStream = new Readable();
readStream._read = ()=>{
readStream.push(streamData);
streamData = null;
};
// Setup file system writable stream.
return await fs.writeFile(filePath, buffer);
};
//# sourceMappingURL=saveBufferToFile.js.map