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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@tigrisdata/keyv-tigris

v1.0.7

Published

Keyv storage adapter for Tigris

Downloads

828

Readme

Tigris Adapter for Keyv

A Tigris Storage adapter for Keyv.

Why use object storage as a key–value store? Tigris excels at handling small objects. Here’s a detailed write-up and benchmark: Benchmarking Small Objects

Installation

npm install @tigrisdata/keyv-tigris keyv

Configuration

Create an account and set up bucket at storage.new

Set up your Tigris credentials using environment variables (you can also use .env file).

TIGRIS_STORAGE_BUCKET=your-bucket-name
TIGRIS_STORAGE_ACCESS_KEY_ID=your-access-key
TIGRIS_STORAGE_SECRET_ACCESS_KEY=your-secret-key
TIGRIS_STORAGE_ENDPOINT=https://t3.storage.dev  # optional, defaults to this
import Keyv from 'keyv';
import { KeyvTigris } from '@tigrisdata/keyv-tigris';

const store = new KeyvTigris();

// Or pass the configuration directly:

const store = new KeyvTigris({
  bucket: 'your-bucket-name',
  accessKeyId: 'your-access-key',
  secretAccessKey: 'your-secret-key',
  endpoint: 'https://t3.storage.dev',
});

const keyv = new Keyv({ store });

Usage

Basic Operations

import Keyv from 'keyv';
import { KeyvTigris } from '@tigrisdata/keyv-tigris';

const keyv = new Keyv({ store: new KeyvTigris() });

// Set a value
await keyv.set('foo', 'bar');

// Get a value
const value = await keyv.get('foo'); // 'bar'

// Delete a key
await keyv.delete('foo');

// Clear all keys
await keyv.clear();

// Check if key exists
await keyv.has('foo'); // false

Using Namespaces

Namespaces allow you to isolate different sets of keys (handled by Keyv):

const users = new Keyv({
  store: new KeyvTigris(),
  namespace: 'users',
});

const sessions = new Keyv({
  store: new KeyvTigris(),
  namespace: 'sessions',
});

// These don't conflict
await users.set('123', { name: 'Alice' });
await sessions.set('123', { token: 'abc' });

Iterating Over Keys

const keyv = new Keyv({ store: new KeyvTigris() });

await keyv.set('key1', 'value1');
await keyv.set('key2', 'value2');

for await (const [key, value] of keyv.iterator()) {
  console.log(key, value);
}

Batch Operations

// Get multiple values
const values = await keyv.get(['key1', 'key2', 'key3']);

// Delete multiple keys
await keyv.delete(['key1', 'key2']);

Error Handling

const store = new KeyvTigris();

store.on('error', (error) => {
  console.error('Storage error:', error);
});

const keyv = new Keyv({ store });

API

Constructor Options (TigrisStorageCoreConfig)

| Option | Type | Description | | ----------------- | -------- | ------------------------------------------------------- | | bucket | string | Tigris bucket name | | accessKeyId | string | Tigris access key ID | | secretAccessKey | string | Tigris secret access key | | endpoint | string | Tigris endpoint URL (default: https://t3.storage.dev) |

License

MIT