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

@heilgar/file-storage-adapter-vercel-blob

v2.0.0

Published

Vercel Blob file storage adapter for Node.js (public + private stores, signed URLs) — unified API shared with the filesystem and AWS S3 adapters.

Readme

File Storage Adapter Vercel Blob

Vercel Blob implementation of the file storage adapter.

Install

npm install @heilgar/file-storage-adapter-vercel-blob

Usage

Public store (default)

import { VercelBlobAdapter } from '@heilgar/file-storage-adapter-vercel-blob';

const adapter = new VercelBlobAdapter({
  token: process.env.BLOB_READ_WRITE_TOKEN, // required
  basePath: 'uploads',                       // optional: prefix for all keys
});

await adapter.upload('images/logo.png', Buffer.from('...'));
const file = await adapter.download('images/logo.png');
const url = await adapter.getSignedUrl('images/logo.png', { expiresIn: 3600 });

Private store

Requires a private Blob store (create one with vercel blob create-store name --access private) and @vercel/blob >= 2.4.0 for signed URLs.

const adapter = new VercelBlobAdapter({
  token: process.env.BLOB_READ_WRITE_TOKEN,
  access: 'private',
});

await adapter.upload('docs/contract.pdf', buffer, { contentType: 'application/pdf' });

// Reads through @vercel/blob `get()` with auth.
const file = await adapter.download('docs/contract.pdf');

// Time-limited signed URL via issueSignedToken + presignUrl.
const url = await adapter.getSignedUrl('docs/contract.pdf', { expiresIn: 600 });

// Signed PUT URL for direct browser uploads (private only).
const { url: putUrl, headers } = await adapter.getSignedUrlUpload('docs/contract.pdf', {
  expiresIn: 600,
  contentType: 'application/pdf',
});

Configuration

interface VercelBlobAdapterConfig {
  token: string;                     // Vercel Blob read/write token
  access?: 'public' | 'private';     // default: 'public'. Must match the store's access mode.
  basePath?: string;                 // optional key prefix
}

Bulk delete

// Remove everything under a folder-like prefix.
const { deleted } = await adapter.deleteByPrefix('exports/');

// Bound how much each list() page returns and how many keys total to delete.
await adapter.deleteByPrefix('exports/', { batch: 50, limit: 500 });

The method paginates through list() with hasMore/cursor and is safe to retry — @vercel/blob's underlying del() no-ops on already-deleted keys.

Notes

  • access must match the Blob store's access mode in Vercel — mixing modes will fail at the API.
  • Public stores: getSignedUrl() returns the underlying public blob URL; getSignedUrlUpload() throws (use upload() directly).
  • Private stores: getSignedUrl() and getSignedUrlUpload() produce HMAC-signed URLs with validUntil = now + expiresIn s.
  • Range downloads are not supported.

Breaking changes in 2.0.0

  • FileMetadata now includes a required key field. list() results expose key with basePath stripped, so the same value round-trips with upload(), delete(), and download(). Consumers reading only name keep working; typed code constructing/asserting on FileMetadata needs key.
  • New deleteByPrefix(prefix, opts?) method on the adapter — see above.