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

@nir.arad/unified-blob-storage

v1.4.1

Published

Unified blob storage interface supporting Vercel Blob, Azure Blob Storage, and Azurite

Downloads

21

Readme

@nir.arad/unified-blob-storage

A unified interface for blob storage supporting Vercel Blob, Azure Blob Storage, Azurite, and Google Drive. This package provides a consistent API across different blob storage providers, making it easy to switch between providers or use different providers in different environments.

Features

  • 🚀 Unified API - Single interface for all supported storage providers
  • 🔄 Provider Flexibility - Switch between Vercel Blob, Azure Blob Storage, Azurite, and Google Drive
  • 🏗️ Environment-Based Configuration - Automatic provider selection based on environment variables
  • Advanced Caching - Hybrid caching with memory and filesystem strategies
  • 🎯 Smart Cache Selection - Automatic cache strategy based on file type and size
  • 🔧 Manual Cache Refresh - Admin-triggered cache updates for static sites
  • 📊 Cache Statistics - Comprehensive performance monitoring and metrics
  • 📦 TypeScript Support - Full TypeScript definitions included
  • 🧪 Comprehensive Testing - 100% test coverage with Jest
  • 📚 Well Documented - Complete API documentation and examples
  • 🔧 Zero Dependencies - Minimal external dependencies

Supported Providers

| Provider | Use Case | Environment | |----------|----------|-------------| | Vercel Blob | Production deployments on Vercel | vercel | | Azure Blob Storage | Enterprise production environments | azure | | Azurite | Local development and testing | azurite | | Google Drive | Read-only access to Google Drive files | google-drive |

Quick Start

npm install @nir.arad/unified-blob-storage
import { UnifiedBlobStorage } from '@nir.arad/unified-blob-storage';

const storage = new UnifiedBlobStorage();

// Fetch files
const content = await storage.fetchFileContent('data/config.json');
const jsonData = await storage.fetchJsonFile('data/galleries/art.json');

// Upload files
await storage.saveFileContent('data/new-file.json', JSON.stringify(data));

// Delete files
await storage.deleteFile('images/category/photo.jpg');

Documentation

Advanced Caching

For high-performance applications, use the cached storage with automatic strategy selection:

import { CachedUnifiedBlobStorage } from '@nir.arad/unified-blob-storage';

const cachedStorage = new CachedUnifiedBlobStorage({
  cacheStrategy: 'filesystem', // Default for large files
  maxCacheSize: 500 * 1024 * 1024, // 500MB
  cacheDir: './cache'
});

await cachedStorage.initialize();

// Files are automatically cached based on type and size
const jsonData = await cachedStorage.fetchJsonFile('data/galleries/art.json'); // → Memory cache
const imageContent = await cachedStorage.fetchFileContent('images/photo.jpg'); // → Filesystem cache

// Manual cache refresh for static sites
await cachedStorage.refreshAllMetadata();

Environment Configuration

The package automatically detects the storage provider based on environment variables:

# For Vercel Blob
BLOB_PROVIDER=vercel
BLOB_BASE_URL=https://your-blob-url.vercel-storage.com

# For Azure Blob Storage
BLOB_PROVIDER=azure
AZURE_STORAGE_CONNECTION_STRING=your-connection-string
AZURE_CONTAINER_NAME=your-container

# For Azurite (local development)
BLOB_PROVIDER=azurite
AZURITE_CONNECTION_STRING=DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=your-account-key;BlobEndpoint=your-blob-endpoint;

# For Google Drive (read-only)
BLOB_PROVIDER=google-drive
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-key.json
# OR
GOOGLE_DRIVE_CREDENTIALS='{"type":"service_account",...}'
GOOGLE_DRIVE_FOLDER_ID=optional-root-folder-id

Development

# Install dependencies
npm install

# Run tests
npm test

# Build package
npm run build

# Build in watch mode
npm run dev

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass
  6. Submit a pull request

License

MIT License - see LICENSE for details.

Support