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

@meistrari/kv

v1.0.2

Published

Client library for KV Service API

Readme

@meistrari/kv

A TypeScript client library for interacting with the KV Service API. This client provides a simple, strongly-typed interface for all KV operations.

Installation

npm install @meistrari/kv
# or
yarn add @meistrari/kv
# or
pnpm add @meistrari/kv

Features

  • Strongly Typed: Full TypeScript support with interfaces for all operations
  • Simple API: Clear and consistent methods for all KV operations
  • Namespace Support: Organize your keys in logical namespaces
  • Batch Operations: Perform multiple operations in a single request
  • Caching Utilities: Simple TTL-based caching
  • Metadata Support: Store and retrieve metadata alongside values
  • Error Handling: Consistent error handling across all API calls
  • API Gateway Support: Built-in Authorization header support for API gateways with data-token integration
  • Production Ready: Defaults to the Tela KV API at https://api.tela.com/kv
  • Dual Package: Both ESM and CommonJS support via unbuild

Usage

import { KVClient } from '@meistrari/kv';

// Create a client instance (defaults to https://api.tela.com/kv)
const kv = new KVClient();

// Basic operations
await kv.put('hello', 'world');
const result = await kv.get('hello');
console.log(result.value); // 'world'

// With namespaces
await kv.putInNamespace('users', 'user-123', {
  name: 'John Doe',
  email: '[email protected]'
});

const user = await kv.getFromNamespace('users', 'user-123');
console.log(user.value.name); // 'John Doe'

// Batch operations
const batchResult = await kv.batch([
  { type: 'get', key: 'hello' },
  { type: 'put', key: 'greeting', value: 'Hello, world!' },
  { type: 'delete', key: 'old-key' }
]);

// Caching with TTL
await kv.cache('weather', { temp: 72, conditions: 'sunny' }, 300); // 5 minute TTL
const weather = await kv.getCached('weather');

API Reference

Basic Key Operations

  • get(key, options): Get a value by key
  • put(key, value, options): Store a value by key
  • delete(key): Delete a value by key
  • listKeys(options): List keys, optionally filtered by prefix

Namespace Operations

  • getFromNamespace(namespace, key, options): Get a value from a namespace
  • putInNamespace(namespace, key, value, options): Store a value in a namespace
  • deleteFromNamespace(namespace, key): Delete a value from a namespace
  • listNamespaceKeys(namespace, options): List keys in a namespace

Batch Operations

  • batch(operations): Perform multiple operations in a single request

Utility Operations

  • cache(key, value, ttl): Cache a value with automatic expiration
  • getCached(key): Get a cached value
  • deleteByPrefix(prefix): Delete all keys with a given prefix
  • healthcheck(): Check if the KV service is available

Configuration

// With API key for the API Gateway
const kv = new KVClient('https://api.tela.com/kv', { apiKey: 'your-api-key' });

License

MIT