Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

import { join } from 'path';
import { writeFile } from 'fs/promises';
import os from 'os';
import AdmZip from 'adm-zip';

Expand All @@ -20,9 +19,7 @@ export function generateTempPath() {

export async function unzipFile(content: string) {
const decoded = Buffer.from(content, 'base64');
const pathToZip = generateTempPath();
await writeFile(pathToZip, decoded);
const zip = new AdmZip(pathToZip);
Comment on lines -23 to -25
Copy link
Copy Markdown
Contributor Author

@elena-shostak elena-shostak Nov 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

In scope of FSH initiative we wanted to migrate fs usage to the @kbn/fs package. However, I've noticed that AdmZip directly accepts Buffer, so it seems there is no need in persistence at all

const zip = new AdmZip(decoded);
const zipEntries = zip.getEntries();

let allData = '';
Expand All @@ -31,5 +28,6 @@ export async function unzipFile(content: string) {
const entryData = entry.getData().toString();
allData += entryData;
}

return allData;
}