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

@stone-js/cloud-file

v0.8.15

Published

Cloud storage for Stone.js: drivers for the agnostic filesystem contract (S3 and S3-compatible: R2, MinIO, Spaces, OSS, COS) with signed upload/download URLs. GCS and Azure Blob to follow.

Downloads

1,844

Readme

Stone.js - Cloud File

npm license npm version npm downloads Maintenance CI Release Quality Gate Status Coverage Security Policy CodeQL Dependabot Status Conventional Commits

Cloud storage for Stone.js. Drivers for the agnostic @stone-js/filesystem contract, plus a signed-URL contract for direct-to-storage uploads and private downloads. Ships drivers for S3 (and every S3-compatible store: Cloudflare R2, MinIO, DigitalOcean Spaces, Alibaba OSS, Tencent COS), Google Cloud Storage and Azure Blob.


Introduction

Your domain talks to the agnostic FileSystem contract (get/put/delete/url/readStream…), never to a cloud SDK. This module supplies the cloud drivers and wires them into the container, so switching or mixing backends (local, s3, …) is configuration, not code. It also adds a signed-URL capability so a client can upload straight to the bucket and download private objects without proxying bytes through your app.

The cloud SDK is never bundled: it is an optional peer dependency, imported lazily on first use. Your module stays lean; you install only the SDK for the provider you actually use.

Installation

npm install @stone-js/cloud-file

# + the SDK for your provider:
npm install @aws-sdk/client-s3 @aws-sdk/s3-request-presigner   # S3 / R2 / MinIO / Spaces / OSS / COS
npm install @google-cloud/storage                              # Google Cloud Storage
npm install @azure/storage-blob                                # Azure Blob

Peer dependencies: @stone-js/core, @stone-js/filesystem.

Usage

Declarative (single disk):

import { StoneApp } from '@stone-js/core'
import { CloudFile } from '@stone-js/cloud-file'

@CloudFile({ driver: 's3', bucket: 'uploads', region: 'eu-west-3' })
@StoneApp({ name: 'app' })
export class Application {}

Imperative / multi-disk via stone.filesystem:

import { defineConfig } from '@stone-js/core'
import { cloudFileBlueprint } from '@stone-js/cloud-file'

export const AppConfig = defineConfig({
  filesystem: {
    default: 's3',
    disks: [
      { name: 's3', driver: 's3', bucket: 'uploads', region: 'eu-west-3' },
      { name: 'r2', driver: 's3', bucket: 'assets', endpoint: 'https://<acct>.r2.cloudflarestorage.com' }
    ]
  }
})

Inject the default disk (fileSystem) or the manager (storage) anywhere:

export class UploadService {
  constructor (private readonly fileSystem) {}       // the default disk
  async save (path, bytes) { await this.fileSystem.put(path, bytes) }
}

Signed URLs (direct-to-cloud upload)

// issue a short-lived upload URL; the client PUTs the file straight to storage
const { url, method, headers } = await fileSystem.temporaryUploadUrl('avatars/1.png', {
  contentType: 'image/png',
  expiresIn: 600
})

// later, a private download URL
const link = await fileSystem.temporaryUrl('avatars/1.png', { expiresIn: 60 })

Use supportsSignedUrls(disk) (from @stone-js/filesystem) to feature-detect before calling.

S3-compatible stores

Point the S3 driver at any S3-compatible endpoint: Cloudflare R2, MinIO (forcePathStyle: true), DigitalOcean Spaces, Alibaba OSS, Tencent COS. Set endpoint (and forcePathStyle where required); everything else is identical.

Documentation

See the official documentation for the full guide.

License

MIT