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

cloud-storage-factory

v1.1.2

Published

[![npm version](https://img.shields.io/npm/v/cloud-storage-factory.svg)](https://www.npmjs.com/package/cloud-storage-factory) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![TypeScript](https:

Downloads

3

Readme

Cloud Storage Factory

npm version License: MIT TypeScript

A robust TypeScript-based SDK that provides a unified interface for interacting with major cloud storage providers (AWS S3, Azure Blob Storage, Google Cloud Storage, and Cloudflare R2). This SDK simplifies cloud storage operations while maintaining type safety and flexibility.

Table of Contents

Features

  • Unified API: Consistent interface across all supported cloud providers
  • File Operations: Upload, download, and delete files with ease
  • Pre-signed URLs: Generate secure, time-limited upload URLs
  • Type Safety: Full TypeScript support with comprehensive type definitions
  • Factory Pattern: Easy provider switching and configuration
  • Zero Dependencies: Lightweight and efficient
  • Async/Await: Modern Promise-based API
  • Extensible: Easy to add support for new cloud providers

Installation

# Using npm
npm install cloud-storage-factory

# Using yarn
yarn add cloud-storage-factory

# Using pnpm
pnpm add cloud-storage-factory

Usage

1. Import the Factory

import { StorageFactory } from 'cloud-storage-factory';

2. Initialize a Provider

AWS S3

const storage = StorageFactory('aws', {
  region: 'us-east-1',
  bucket: 'your-bucket-name',
  credentials: {
    accessKeyId: 'your-access-key',
    secretAccessKey: 'your-secret-key',
  },
});

Azure Blob Storage

const storage = StorageFactory('azure', {
  accountName: 'your-account-name',
  accountKey: 'your-account-key',
  containerName: 'your-container-name',
});

Google Cloud Storage

const storage = StorageFactory('gcp', {
  bucket: 'your-gcp-bucket-name',
  keyFilename: 'path/to/service-account.json',
});

Cloudflare R2

const storage = StorageFactory('r2', {
  accountId: 'your-account-id',
  accessKeyId: 'your-access-key-id',
  secretAccessKey: 'your-secret-access-key',
  bucket: 'your-bucket-name',
});

3. Use the Storage Methods

// Upload a file
await storage.uploadFile('local/path.txt', 'remote/path.txt');

// Generate a pre-signed upload URL (valid for 1 hour)
const url = await storage.uploadPreSignedUrl('remote/upload.txt');

// Download a file
await storage.downloadFile('remote/path.txt', 'local/downloaded.txt');

// Delete a file
await storage.deleteFile('remote/path.txt');

Supported Cloud Providers

| Provider | Required Config | | -------- | ----------------------------------------------- | | AWS | region, bucket, accessKeyId, secretAccessKey | | Azure | accountName, accountKey, containerName | | GCP | bucket, keyFilename | | R2 | accountId, accessKeyId, secretAccessKey, bucket |

Troubleshooting

Common Issues

  1. Authentication Errors

    • Verify your credentials are correct
    • Check if your credentials have expired
    • Ensure proper permissions are set
  2. Network Issues

    • Check your internet connection
    • Verify firewall settings
    • Ensure proper endpoint configuration
  3. File Operations

    • Verify file paths are correct
    • Check file permissions
    • Ensure sufficient storage space

Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Setup

# Clone the repository
git clone https://github.com/Anshuljain30/cloud-storage-factory.git

# Install dependencies
npm install

# Run tests
npm test

# Build the project
npm run build

License

MIT License © 2025


Made with ❤️ by Anshul Jain