npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

stackblitz-clone

v0.0.7

Published

Clone StackBlitz projects to local directories

Readme

stackblitz-zip

Download StackBlitz projects programmatically

npm version npm downloads Github Actions Codecov

❓ Why?

While StackBlitz provides an API to fetch project data, there's no built-in way to download projects as zip files programmatically. This tool makes it easy to download reproductions for issues quickly.

[!IMPORTANT] This project is not affiliated with or endorsed by StackBlitz in any way. Users are responsible for ensuring their use of this tool complies with StackBlitz's Terms of Service. Please review their terms before using this tool.

🌐 stackblitz.zip

The easiest way to download a StackBlitz project is at stackblitz.zip

Simply replace stackblitz.com with stackblitz.zip in any StackBlitz edit URL:

Original:  https://stackblitz.com/edit/nuxt-starter-k7spa3r4
Download:  https://stackblitz.zip/edit/nuxt-starter-k7spa3r4

Features

  • 🔓 No authentication or API keys required!
  • ⚗️ Built on Nitro
  • ▲ Deployed on Vercel

👉 see source

CLI

# download a project as a zip file
npx stackblitz-zip https://stackblitz.com/edit/nuxt-starter-k7spa3r4

# specify output path for zip
npx stackblitz-zip https://stackblitz.com/edit/nuxt-starter-k7spa3r4 my-project.zip

# clone project to a directory
npx stackblitz-clone https://stackblitz.com/edit/nuxt-starter-k7spa3r4

# clone to a specific directory
npx stackblitz-clone https://stackblitz.com/edit/nuxt-starter-k7spa3r4 ./my-project

Programmatic Usage

Install the package:

npm install stackblitz-zip

Node.js

import { cloneProject, downloadToFile, parseUrl } from 'stackblitz-zip'

// download from a URL as a zip file
const projectId = parseUrl('https://stackblitz.com/edit/nuxt-starter-k7spa3r4')
await downloadToFile({ projectId, outputPath: './output.zip' })

// download by project ID
await downloadToFile({
  projectId: 'nuxt-starter-k7spa3r4',
  outputPath: './my-project.zip',
})

// clone project to a directory
await cloneProject({
  projectId: 'nuxt-starter-k7spa3r4',
  outputPath: './my-project',
})

Web APIs

import { downloadToBlob, downloadToResponse, parseUrl } from 'stackblitz-zip'

// download as Web Response (edge runtimes, servers)
const projectId = parseUrl('https://stackblitz.com/edit/nuxt-starter-k7spa3r4')
const response = await downloadToResponse({ projectId })
// response can be returned directly from edge functions

// or download as Blob (browser-friendly)
const blob = await downloadToBlob({ projectId })

// trigger browser download
const url = URL.createObjectURL(blob)
const a = document.createElement('a')
a.href = url
a.download = `${projectId}.zip`
a.click()
URL.revokeObjectURL(url)

[!NOTE] Direct browser usage may be blocked by CORS when fetching from stackblitz.com.

Features

  • Universal - works in Node.js, browsers, and edge runtimes
  • Built with tsdown and JSZip
  • Nitro web service at stackblitz.zip
  • No browser automation - parses embedded Redux store directly
  • Zip slip protection and security validations
  • Configurable size limits and timeouts
  • Web API streaming (ArrayBuffer/Blob)

[!NOTE] The APIs use Web standards (fetch, ArrayBuffer, Blob) but direct fetching from stackblitz.com may be blocked by CORS.

Security

  • ✅ Zip slip protection - file paths are sanitized to prevent directory traversal
  • ✅ Size limits - configurable limits on file size (10MB) and total size (100MB)
  • ✅ Request timeout - prevents hanging requests (30s default)
  • ✅ Project ID validation - only alphanumeric, hyphens, and underscores
  • ✅ Memory efficient - streaming support with no temporary files

Self-Hosting

Self-host the web service using the included Nitro app:

cd app
pnpm install
pnpm build
pnpm preview

Deploy to any platform using Nitro's deployment presets - supports Vercel, Netlify, Cloudflare Pages, AWS, Azure, Node.js, and many more.

API

downloadToFile(options: DownloadOptions): Promise<string>

Downloads a StackBlitz project and returns the path to the created zip file.

Options:

  • projectId (string, required): The StackBlitz project ID
  • outputPath (string, optional): Path where the zip file should be saved. Defaults to <project-id>.zip
  • timeout (number, optional): Timeout in milliseconds for loading the project. Defaults to 30000 (30 seconds)
  • maxFileSize (number, optional): Maximum size per file in bytes. Defaults to 10485760 (10MB)
  • maxTotalSize (number, optional): Maximum total project size in bytes. Defaults to 104857600 (100MB)
  • verbose (boolean, optional): Enable console logging. Defaults to false

cloneProject(options: CloneOptions): Promise<string>

Clones a StackBlitz project by creating all files in a target directory.

Options:

  • projectId (string, required): The StackBlitz project ID
  • outputPath (string, optional): Path where the project directory should be created. Defaults to <project-id>/
  • timeout (number, optional): Timeout in milliseconds for loading the project. Defaults to 30000 (30 seconds)
  • maxFileSize (number, optional): Maximum size per file in bytes. Defaults to 10485760 (10MB)
  • maxTotalSize (number, optional): Maximum total project size in bytes. Defaults to 104857600 (100MB)
  • verbose (boolean, optional): Enable console logging. Defaults to false

Returns: Path to the created directory

downloadToResponse(options): Promise<Response>

Downloads a StackBlitz project and returns it as a Web Response (universal).

Options: Same as downloadToFile except outputPath

Returns: A Response object containing the zip file stream

downloadToBuffer(options): Promise<ArrayBuffer>

Downloads a StackBlitz project and returns it as an ArrayBuffer (universal).

Options: Same as downloadToFile except outputPath

downloadToBlob(options): Promise<Blob>

Downloads a StackBlitz project and returns it as a Blob (browser-friendly).

Options: Same as downloadToFile except outputPath

parseUrl(url: string): string

Parse a StackBlitz URL and extract the project ID.

Parameters:

  • url (string, required): Full StackBlitz project URL (e.g., https://stackblitz.com/edit/project-id)

Returns: The project ID

Development

# clone this repository
git clone https://github.com/danielroe/stackblitz.zip

# install dependencies
corepack enable
pnpm install

# run interactive tests
pnpm dev

# build for production
pnpm build

License

Made with ❤️

Published under MIT License.