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

@byoc/core

v0.4.0

Published

Core universal storage abstraction for BYOC (Bring Your Own Cloud)

Readme

@byoc/core

Universal storage abstraction for BYOC (Bring Your Own Cloud): one API for storage that end users, organizations, or infrastructure teams already own.

Part of the BYOC monorepo. Requires at least one provider adapter.

Install

npm install @byoc/core
# plus an adapter
npm install @byoc/google-drive    # or @byoc/s3-compatible, @byoc/webdav

Usage

import { BYOC } from "@byoc/core";
import { GoogleDriveProvider } from "@byoc/google-drive";

const storage = new BYOC({
  provider: new GoogleDriveProvider({
    auth: { clientId: process.env.GOOGLE_CLIENT_ID! },
    rootFolderName: "MyApplication"
  })
});

await storage.connect();

await storage.writeText("documents/welcome.md", "# Hello from BYOC!");
const content = await storage.readText("documents/welcome.md");

What's in this package

| Export | Purpose | | :--- | :--- | | BYOC | The universal client: upload, download, list, delete, move, quota | | BYOCProvider | The interface every adapter implements | | MigrationEngine | Stream-piped transfer between any two registered providers | | E2EECrypto, EncryptedStorageWrapper | Client-side AES-256-GCM encryption over any provider | | StorageError, BYOCErrorCode | Provider-neutral error taxonomy with retryable flags | | normalizeVirtualPath, encodePathSegments | Path sanitization and RFC 3986 encoding | | SafeLogger | Logging with automatic token/credential redaction | | withRetry | Exponential backoff for rate-limited providers |

Multi-provider and migration

const storage = new BYOC({
  providers: [gdrive, s3, webdav],
  defaultProviderId: "google-drive"
});

storage.useProvider("s3-compatible");

const report = await storage.migrate({
  from: "google-drive",
  to: "webdav",
  paths: ["documents/report.pdf"],
  onProgress: (p) => console.log(`${p.currentFile} (${p.percentage}%)`)
});

Client-side encryption

EncryptedStorageWrapper wraps any provider so plaintext never leaves the process. New objects use the framed BYOC_E2EE_V3 format, and uploads are encrypted as a stream with memory bounded by the configured frame size. V1 and V2 objects remain readable.

import { EncryptedStorageWrapper } from "@byoc/core";

const secure = new EncryptedStorageWrapper(gdrive, {
  passphrase: process.env.USER_PASSPHRASE!,
  frameSize: 256 * 1024
});

await secure.upload("videos/demo.mp4", videoStream, {
  contentLength: videoSize,
  mimeType: "video/mp4"
});

For direct pipelines, E2EECrypto.encryptStream() and E2EECrypto.decryptStream() accept iterables of byte chunks. Provider transport support still varies: TypeScript Local, WebDAV, and S3 consume streams directly; S3 requires an exact contentLength, and Google Drive currently buffers before its resumable upload loop. encryptedSize() returns the exact V3 length when a custom pipeline needs to set its own transport header.

Provider independence

@byoc/core contains no provider-specific concepts. Drive file IDs, S3 object keys, and WebDAV collections stay private to their adapters. Core speaks only in path, id, providerId, StorageObject, and StorageQuota.

License

Apache-2.0