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

kachy-valkey

v0.1.0

Published

High-performance Valkey client with automatic authentication and multi-tenancy

Downloads

7

Readme

Kachy Valkey Node.js Client

High-performance Valkey client with automatic authentication and multi-tenancy support for Node.js.

Installation

npm install kachy-valkey

Quick Start

const kachy = require('kachy-valkey');

async function main() {
  try {
    // Initialize the client
    kachy.init(process.env.KACHY_ACCESS_KEY);
    
    console.log('🚀 Kachy Valkey client initialized!');
    
    // Basic operations
    await kachy.set('greeting', 'Hello, World!');
    await kachy.set('user:123:name', 'John Doe');
    await kachy.set('session:abc', 'active', 3600); // 1 hour expiration
    
    // Retrieve values
    const greeting = await kachy.get('greeting');
    const userName = await kachy.get('user:123:name');
    const session = await kachy.get('session:abc');
    
    console.log(`Greeting: ${greeting}`);
    console.log(`User name: ${userName}`);
    console.log(`Session: ${session}`);
    
    // Check if keys exist
    const existsGreeting = await kachy.exists('greeting');
    console.log(`Greeting exists: ${existsGreeting}`);
    
    // Get TTL
    const ttl = await kachy.ttl('session:abc');
    console.log(`Session TTL: ${ttl} seconds`);
    
    // Cleanup
    await kachy.delete('greeting');
    await kachy.delete('user:123:name');
    await kachy.delete('session:abc');
    
    // Close connection
    kachy.close();
    
  } catch (error) {
    console.error('❌ Error:', error.message);
  }
}

main();

Advanced Operations

Custom Valkey Commands

// Hash operations
await kachy.valkey('HMSET', 'user:123:profile', 'age', '30', 'city', 'New York');
const profile = await kachy.valkey('HMGET', 'user:123:profile', 'age', 'city');
console.log(`User profile: ${JSON.stringify(profile)}`);

// List operations
await kachy.valkey('LPUSH', 'notifications:123', 'Welcome message');
await kachy.valkey('LPUSH', 'notifications:123', 'System update');
const notifications = await kachy.valkey('LRANGE', 'notifications:123', 0, -1);
console.log(`Notifications: ${JSON.stringify(notifications)}`);

Pipeline Operations

// Batch operations for better performance
const pipeline = kachy.pipeline();
pipeline.set('batch:1', 'value1');
pipeline.set('batch:2', 'value2');
pipeline.set('batch:3', 'value3');
const results = await pipeline.execute();

console.log(`Pipeline results: ${JSON.stringify(results)}`);

Configuration

Configure the client using environment variables:

  • KACHY_ACCESS_KEY: Your authentication access key (required)
  • KACHY_BASE_URL: API base URL (default: https://api.klache.net)
  • KACHY_TIMEOUT: Request timeout in seconds (default: 30)
  • KACHY_MAX_RETRIES: Maximum retry attempts (default: 3)
  • KACHY_RETRY_DELAY: Delay between retries in seconds (default: 1.0)
  • KACHY_POOL_SIZE: Connection pool size (default: 10)

API Reference

| Operation | Method | Description | |-----------|--------|-------------| | set | await kachy.set(key, value, ex?) | Set key-value pair with optional expiration | | get | await kachy.get(key) | Get value by key | | delete | await kachy.delete(key) | Delete a key | | exists | await kachy.exists(key) | Check if key exists | | expire | await kachy.expire(key, seconds) | Set expiration for key | | ttl | await kachy.ttl(key) | Get time to live for key | | valkey | await kachy.valkey(command, ...args) | Execute any Valkey command | | pipeline | kachy.pipeline() | Create pipeline for batch operations |

Requirements

  • Node.js 16+
  • axios ^1.6.0

Development

# Clone the repository
git clone https://github.com/Klug-Labs/kachy-valkey-node.git
cd kachy-valkey-node

# Install dependencies
npm install

# Build the package
npm run build

# Run tests
npm test

License

MIT License - see LICENSE file for details.

Support

  • Documentation: https://docs.klache.net
  • API Status: https://status.klache.net
  • Support Email: [email protected]