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

@buckt/sdk

v1.0.0

Published

Official TypeScript SDK for the Buckt API. Zero runtime dependencies, uses native `fetch`.

Readme

@buckt/sdk

Official TypeScript SDK for the Buckt API. Zero runtime dependencies, uses native fetch.

Installation

npm install @buckt/sdk

Quick Start

import { Buckt } from '@buckt/sdk'

const client = new Buckt({ apiKey: 'bkt_...' })

const bucket = await client.buckets.create({
  name: 'Assets',
  customDomain: 'assets.acme.com',
})

Configuration

const client = new Buckt({
  apiKey: 'bkt_...', // required
  baseUrl: 'https://api.buckt.dev', // optional, this is the default
})

Resources

Buckets (client.buckets)

// Create
const bucket = await client.buckets.create({
  name: 'Assets',
  customDomain: 'assets.acme.com',
  region: 'us-east-1',          // optional
  visibility: 'public',         // optional: 'public' | 'private'
  cachePreset: 'aggressive',    // optional: 'no-cache' | 'short' | 'standard' | 'aggressive' | 'immutable'
  corsOrigins: ['https://acme.com'], // optional
  lifecycleTtlDays: 90,         // optional
  optimizationMode: 'balanced', // optional: 'none' | 'light' | 'balanced' | 'maximum'
})

// List (cursor-based pagination)
const { data: buckets, meta } = await client.buckets.list({
  cursor: undefined, // optional
  limit: 20,         // optional
  status: 'active',  // optional filter
})

// Get
const bucket = await client.buckets.get('bucket-id')

// Update
const updated = await client.buckets.update('bucket-id', {
  name: 'New Name',
  cachePreset: 'immutable',
})

// Delete
await client.buckets.delete('bucket-id')

Files (client.files)

// Upload
await client.files.upload('bucket-id', 'images/logo.png', buffer, 'image/png', {
  optimization: 'balanced', // optional: triggers server-side image optimization
})

// List
const { data: files, meta } = await client.files.list('bucket-id', {
  prefix: 'images/',  // optional
  cursor: undefined,   // optional
  limit: 50,           // optional
})

// Get metadata
const file = await client.files.get('bucket-id', 'images/logo.png')

// Delete
await client.files.delete('bucket-id', 'images/logo.png')

Keys (client.keys)

// Create
const key = await client.keys.create({
  name: 'Read-only key',
  permissions: ['buckets:read', 'files:read'],
  expiresAt: '2025-12-31T00:00:00Z', // optional
})
// key.secret contains the raw key (only shown once)

// List (summary fields only: id, name, prefix, lastUsedAt, createdAt)
const { data: keys, meta } = await client.keys.list()

// Get (full detail: adds permissions, bucketIds, expiresAt)
const key = await client.keys.get('key-id')

// Delete
await client.keys.delete('key-id')

Permissions

buckets:read buckets:write buckets:delete files:read files:write files:delete keys:read keys:write

Error Handling

All errors extend BucktError with .status and .message properties:

| Class | Status | |---|---| | ValidationError | 400 | | UnauthorizedError | 401 | | PaymentRequiredError | 402 | | ForbiddenError | 403 | | NotFoundError | 404 | | TimeoutError | 408 | | ConflictError | 409 | | RateLimitError | 429 |

import { Buckt, NotFoundError, RateLimitError } from '@buckt/sdk'

try {
  await client.buckets.get('nonexistent')
} catch (err) {
  if (err instanceof NotFoundError) {
    // handle 404
  }
  if (err instanceof RateLimitError) {
    // back off and retry
  }
}

Pagination

All list methods return cursor-based pagination:

let cursor: string | undefined

do {
  const { data, meta } = await client.buckets.list({ cursor })
  // process data
  cursor = meta.nextCursor
} while (cursor)

Build

Built with tsup. Outputs ESM (dist/index.js), CJS (dist/index.cjs), and type declarations.