Modules@robinpath/redis

@robinpath/redis

0.1.0Public

Redis client with strings, hashes, lists, sets, pub/sub, TTL, and connection management

@robinpath/redis

Redis client with strings, hashes, lists, sets, pub/sub, TTL, and connection management

Category Functions Auth License

Why use this module?

The redis module lets you:

  • Get value by key
  • Delete key(s)
  • Check key exists
  • Find keys by pattern
  • Get key TTL

All functions are callable directly from RobinPath scripts with a simple, consistent API.

Installation

npm install @robinpath/redis

Quick Start

1. Set up credentials

redis.connect {"host": "localhost"}

2. Get value by key

redis.get "user:1"

Available Functions

FunctionDescription
redis.connectConnect to Redis
redis.getGet value by key
redis.setSet key-value
redis.delDelete key(s)
redis.existsCheck key exists
redis.keysFind keys by pattern
redis.ttlGet key TTL
redis.expireSet key expiration
redis.incrIncrement value
redis.decrDecrement value
redis.hgetGet hash field
redis.hsetSet hash fields
redis.hgetallGet all hash fields
redis.hdelDelete hash fields
redis.lpushPush to list head
redis.rpushPush to list tail
redis.lpopPop from list head
redis.rpopPop from list tail
redis.lrangeGet list range
redis.llenGet list length
redis.saddAdd to set
redis.smembersGet set members
redis.sismemberCheck set membership
redis.sremRemove from set
redis.publishPublish message to channel
redis.flushdbFlush current database
redis.closeClose connection
redis.closeAllClose all connections

Examples

Get value by key

redis.get "user:1"

Set key-value

redis.set "user:1" {"name": "Alice"} 3600

Delete key(s)

redis.del "user:1"

Integration with RobinPath

import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/redis";

const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);

const result = await rp.executeScript(`
  redis.connect {"host": "localhost"}
  redis.get "user:1"
`);

Full API Reference

See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.

Related Modules

License

MIT

Versions (1)

VersionTagPublished
0.1.0latestyesterday
Install
$ robinpath install @robinpath/redis
Version0.1.0
LicenseMIT
Unpacked Size6.2 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

Category

data