Skip to content

Instantly share code, notes, and snippets.

@Kitketovsky
Created June 16, 2023 17:07
Show Gist options
  • Save Kitketovsky/e68623ef928ba46c3a7f2d02ba7f85fb to your computer and use it in GitHub Desktop.
Save Kitketovsky/e68623ef928ba46c3a7f2d02ba7f85fb to your computer and use it in GitHub Desktop.
From binary to .zip with JSZip
import fs from "fs";
import JSZip from "jszip";
export default async function fromBinaryToZip() {
const data = await dbx.filesDownloadZip({ path: "/br1" });
const zip = new JSZip();
await zip.loadAsync(binaryData);
const content = await zip.generateAsync({ type: "nodebuffer" });
fs.writeFileSync(filePath, content);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment