@@ -70,10 +70,14 @@ await downloadToFile({
7070### Web APIs
7171
7272``` typescript
73- import { downloadToBlob , parseUrl } from ' stackblitz-zip'
73+ import { downloadToBlob , downloadToResponse , parseUrl } from ' stackblitz-zip'
7474
75- // download as Blob (browser-friendly )
75+ // download as Web Response (edge runtimes, servers )
7676const projectId = parseUrl (' https://stackblitz.com/edit/nuxt-starter-k7spa3r4' )
77+ const response = await downloadToResponse ({ projectId })
78+ // response can be returned directly from edge functions
79+
80+ // or download as Blob (browser-friendly)
7781const blob = await downloadToBlob ({ projectId })
7882
7983// trigger browser download
@@ -136,6 +140,14 @@ Downloads a StackBlitz project and returns the path to the created zip file.
136140- ` maxTotalSize ` (number, optional): Maximum total project size in bytes. Defaults to ` 104857600 ` (100MB)
137141- ` verbose ` (boolean, optional): Enable console logging. Defaults to ` false `
138142
143+ ### ` downloadToResponse(options): Promise<Response> `
144+
145+ Downloads a StackBlitz project and returns it as a Web Response (universal).
146+
147+ ** Options:** Same as ` downloadToFile ` except ` outputPath `
148+
149+ ** Returns:** A Response object containing the zip file stream
150+
139151### ` downloadToBuffer(options): Promise<ArrayBuffer> `
140152
141153Downloads a StackBlitz project and returns it as an ArrayBuffer (universal).
0 commit comments