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

@deploybay/sdk

v1.0.1

Published

SDK for DeployBay serverless applications

Readme

DeployBay SDK

SDK for DeployBay serverless applications.

Installation

Beta Version

npm install @deploybay/sdk@beta

This package is automatically installed when you run npm install -g @deploybay/cli@beta.

Usage

The DeployBay SDK provides a simple, clean interface for common application needs:

Key-Value Storage

import { store } from '@deploybay/sdk';

// Store a value
await store.put('user:123', JSON.stringify({ name: 'John', email: '[email protected]' }));

// Retrieve a value
const userData = await store.get('user:123');
const user = userData ? JSON.parse(userData) : null;

// Delete a value
await store.delete('user:123');

Database Operations

import { data } from '@deploybay/sdk';

// Run a SQL query
const users = await data.query('SELECT * FROM users WHERE active = ?', [true]);

// Prepare statements for better performance
const stmt = data.prepare('SELECT * FROM users WHERE status = ?');
const activeUsers = await stmt.first();

// Use transactions for atomic operations
const transaction = await data.beginTransaction();
try {
  await transaction.query('UPDATE accounts SET balance = balance - ? WHERE id = ?', [100, 1]);
  await transaction.query('UPDATE accounts SET balance = balance + ? WHERE id = ?', [100, 2]);
  await transaction.commit();
} catch (error) {
  await transaction.rollback();
  throw error;
}

File Storage

import { media } from '@deploybay/sdk';

// Upload a file
const fileData = new ArrayBuffer(1024); // Your file data
await media.put('uploads/photo.jpg', fileData, {
  metadata: { contentType: 'image/jpeg', size: '1024' }
});

// Download a file
const downloadedFile = await media.get('uploads/photo.jpg');

// List files with prefix
const { objects } = await media.list({ prefix: 'uploads/', limit: 50 });

// Delete a file
await media.delete('uploads/photo.jpg');

Configuration

import { config } from '@deploybay/sdk';

// Get configuration values
const apiKey = config.get('API_KEY');
const databaseUrl = config.get('DATABASE_URL');

// Environment detection
if (config.isDevelopment()) {
  console.log('Running in development mode');
}

// Access secrets (automatically decrypted)
const jwtSecret = config.getSecret('JWT_SECRET');

API Reference

Store

  • get(key: string, options?: StorageOptions): Promise<string | object | ArrayBuffer | ReadableStream | null> - Retrieve a value by key
  • put(key: string, value: string | ArrayBuffer | ArrayBufferView | ReadableStream, options?: StorageOptions): Promise<void> - Store a value by key
  • delete(key: string): Promise<void> - Delete a key-value pair
  • getWithMetadata(key: string, options?: StorageOptions): Promise<{value: any, metadata: any}> - Get value with metadata
  • getMany(keys: string[], options?: StorageOptions): Promise<Map<string, any>> - Get multiple values
  • list(options?: {prefix?: string, limit?: number, cursor?: string}): Promise<{keys: string[], list_complete: boolean, cursor?: string}> - List keys

Data

  • query(sql: string, params?: any[]): Promise<any> - Run a SQL query
  • prepare<T>(sql: string): PreparedStatement<T> - Prepare a statement for reuse
  • batch(operations: {sql: string, params?: any[]}[]): Promise<any[]> - Execute multiple operations
  • beginTransaction(): Promise<Transaction> - Start a database transaction
  • withSession(mode?: string): DatabaseSession - Create a session with consistency
  • exec(sql: string): Promise<any> - Execute SQL directly
  • dump(): Promise<ArrayBuffer> - Export database dump

Media

  • put(key: string, data: string | ArrayBuffer | ArrayBufferView | Blob, options?: {metadata?: Record<string, string>, httpMetadata?: Record<string, string>}): Promise<void> - Upload a file
  • get(key: string): Promise<ArrayBuffer | null> - Download a file
  • delete(key: string): Promise<void> - Delete a file
  • list(options?: {prefix?: string, limit?: number, cursor?: string}): Promise<{objects: any[], truncated: boolean, cursor?: string}> - List files
  • createMultipartUpload(key: string, options?): Promise<{uploadId: string}> - Start multipart upload
  • uploadPart(key: string, uploadId: string, partNumber: number, data: ArrayBuffer): Promise<{etag: string}> - Upload part
  • completeMultipartUpload(key: string, uploadId: string, parts: {partNumber: number, etag: string}[]): Promise<void> - Complete upload

Config

  • get(key: string): string | undefined - Get a configuration value
  • getVar(key: string): string | undefined - Get an environment variable
  • getSecret(key: string): string | undefined - Get a secret (automatically decrypted)
  • isDevelopment(): boolean - Check if in development environment
  • isProduction(): boolean - Check if in production environment
  • isStaging(): boolean - Check if in staging environment
  • getEnvironment(): string - Get current environment name

AI

  • run<T>(model: string, params: Record<string, any>): Promise<T> - Run AI model inference