open-index/open-npm huggingface dataset:
npm package: @meistrari/bolt
Description: Elegant load testing, via Bun
Author: meistrari
Latest version: 0.0.2

<h1 align="center">bolt</h1>

<p align="center">
  <strong>Elegant load testing, on Bun</strong>
</p>

<p align="center">
  <a href="#installation">installation</a> •
  <a href="#usage">usage</a> •
  <a href="#examples">examples</a> •
  <a href="#configuration">configuration</a>
</p>

## installation

```bash
bun add @meistrari/bolt
```

## usage

bolt allows you to easily set up and run performance tests.

```typescript
import { createBoltRunner, defineImplementation } from '@meistrari/bolt'

// define your test implementation
defineImplementation(async ({ url }) => {
    const res = await fetch(url)
    if (!res.ok)
        throw new Error(`http error! status: ${res.status}`)
    return res.json()
})

// create and run your tests
const runner = createBoltRunner('your-test-file.ts')

await runner([
    {
        name: 'get posts',
        iterations: 100,
        concurrency: 10,
        data: { url: 'https://api.example.com/posts' },
    },
])
```

## examples

### http api test

test implementation (`http-api-test.ts`):

```typescript
import { defineImplementation } from '@meistrari/bolt'

defineImplementation(async ({ url }) => {
    const res = await fetch(url)
    if (!res.ok)
        throw new Error(`http error! status: ${res.status}`)
    return res.json()
})
```

running tests (`http-api.ts`):

```typescript
import { createBoltRunner } from '@meistrari/bolt'

const runner = createBoltRunner('http-api-test.ts')

await runner([
    {
        name: 'entity list',
        iterations: 2,
        concurrency: 2,
        data: { url: 'https://jsonplaceholder.typicode.com/posts' },
    },
    {
        name: 'single entity',
        iterations: 10,
        concurrency: 10,
        data: { url: 'https://jsonplaceholder.typicode.com/posts/1' },
    },
])
```

## configuration

bolt tests are configured using scenario objects:

```typescript
{
    name: string // name of the test scenario
    iterations: number // number of times to run the test
    concurrency: number // number of concurrent requests
    data: any // data to pass to the test implementation
}
```

for more advanced configuration options, please refer to the documentation.

---

<p align="center">
  made with ❤️ by <a href="https://github.com/meistrari">meistrari</a>
</p>
npm package: @meistrari/kv
Description: Client library for KV Service API
Author: Meistrari
Latest version: 1.0.2

# @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

```bash
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

```typescript
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: 'john@example.com'
});

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

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

## License

MIT