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

byos-sdk

v0.1.0

Published

Official Developer SDK for BYOS (Bring Your Own Storage) - drop-in S3-compatible object storage backed by user storage connections.

Downloads

16

Readme

BYOS SDK (byos-sdk)

Official TypeScript / Node.js Developer SDK for BYOS (Bring Your Own Storage) — turn standard Google Drive storage accounts into drop-in, S3-compatible cloud object storage.

Installation

npm install byos-sdk

(Zero runtime dependencies! Lightweight, Edge-ready, and works out of the box in Node.js 18+, Next.js API routes, Cloudflare Workers, and modern web browsers.)


Quick Start (5 Lines to First Upload)

import BYOSClient from "byos-sdk";

const byos = new BYOSClient({ apiKey: "byos_live_xxx", bucket: "my-bucket" });

// Upload any string, Buffer, Blob, File, or ReadableStream instantly:
const res = await byos.upload("avatars/user.png", myFileBuffer, { contentType: "image/png" });
console.log("Uploaded object ETag:", res.etag);

Migration Guide (@aws-sdk/client-s3 ➜ byos-sdk)

Replacing cumbersome AWS SDK command objects with byos-sdk reduces boilerplate code by up to 80% while retaining familiar method arguments and behaviors.

| Operation | @aws-sdk/client-s3 (AWS S3) | byos-sdk (BYOS) | | :--- | :--- | :--- | | Initialize Client | new S3Client({ region: "us-east-1", credentials: { ... } }) | new BYOSClient({ apiKey: "byos_live_...", bucket: "my-bucket" }) | | PutObjectCommand | await s3.send(new PutObjectCommand({ Bucket: "b", Key: "k", Body: buf, ContentType: "image/png" })) | await byos.upload("k", buf, { contentType: "image/png" }) | | GetObjectCommand | const res = await s3.send(new GetObjectCommand({ Bucket: "b", Key: "k" })); const str = await res.Body.transformToString(); | const res = await byos.download("k"); const str = await res.text(); | | DeleteObjectCommand| await s3.send(new DeleteObjectCommand({ Bucket: "b", Key: "k" })) | await byos.delete("k") | | ListObjectsV2Command| await s3.send(new ListObjectsV2Command({ Bucket: "b", Prefix: "p/", MaxKeys: 100 })) | await byos.list({ prefix: "p/", maxKeys: 100 }) | | getSignedUrl | await getSignedUrl(s3, new GetObjectCommand({ Bucket: "b", Key: "k" }), { expiresIn: 3600 }) | await byos.getSignedUrl("k", { operation: "get", expiresIn: 3600 }) |


Advanced Features & Capabilities

1. Robust Exponential Backoff Retries

By default, the client handles rate limits (429 Too Many Requests) and temporary network service disturbances (500/502/503/504) with automatic exponential backoff and randomized jitter (configurable up to maxRetries: 3 attempts).

2. Typed Exception Hierarchy

Easily handle different failure modes using specialized subclasses extending BYOSError:

import BYOSClient, { BYOSNotFoundError, BYOSAuthError, BYOSQuotaError } from "byos-sdk";

try {
  await byos.download("non-existent-file.png");
} catch (err) {
  if (err instanceof BYOSNotFoundError) {
    console.error("File is missing in storage (404 / NoSuchKey):", err.message);
  } else if (err instanceof BYOSQuotaError) {
    console.error("Plan storage limit exceeded (507):", err.message);
  } else if (err instanceof BYOSAuthError) {
    console.error("Invalid API token or insufficient scopes (401/403):", err.message);
  }
}

3. Historical Object Versioning & Restoration

Easily list or restore archived revisions without worrying about cloud garbage collection:

// 1. Inspect version history
const history = await byos.listVersions("config.json");

// 2. Restore an older snapshot as the brand new active version
if (history.versions.length > 1) {
  await byos.restoreVersion("config.json", history.versions[1].versionId);
}

4. Seamless Runtime Compatibility

  • In Node.js: Pass standard Buffer or fs.createReadStream() streams into upload() and read outputs using .buffer().
  • In Browser / Edge: Pass standard HTML <input type="file" /> File, Blob, or text strings directly into upload() and read outputs using .blob() or .arrayBuffer().