🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@robinpath/cache

Package Overview
Dependencies
Maintainers
4
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@robinpath/cache

> In-memory key-value cache with optional TTL expiration for temporary data storage

npmnpm
Version
0.1.1
Version published
Weekly downloads
18
-18.18%
Maintainers
4
Weekly downloads
 
Created
Source

@robinpath/cache

In-memory key-value cache with optional TTL expiration for temporary data storage

Category Functions Auth License

Why use this module?

The cache module lets you:

  • Retrieve a value from the cache by key
  • Check if a non-expired key exists in the cache
  • Remove a key from the cache
  • Remove all entries from the cache
  • Get all non-expired keys in the cache

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

Installation

npm install @robinpath/cache

Quick Start

No credentials needed — start using it right away:

cache.get "user:1" "unknown"

Available Functions

FunctionDescription
cache.setStore a value in the cache with an optional TTL
cache.getRetrieve a value from the cache by key
cache.hasCheck if a non-expired key exists in the cache
cache.deleteRemove a key from the cache
cache.clearRemove all entries from the cache
cache.keysGet all non-expired keys in the cache
cache.valuesGet all non-expired values in the cache
cache.sizeGet the number of non-expired entries in the cache
cache.ttlGet the remaining time-to-live for a cache key
cache.setManyStore multiple key-value pairs in the cache at once
cache.getManyRetrieve multiple values from the cache by keys
cache.deleteManyRemove multiple keys from the cache at once

Examples

Retrieve a value from the cache by key

cache.get "user:1" "unknown"

Check if a non-expired key exists in the cache

cache.has "user:1"

Remove a key from the cache

cache.delete "user:1"

Integration with RobinPath

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

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

const result = await rp.executeScript(`
  cache.get "user:1" "unknown"
`);

Full API Reference

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

License

MIT

FAQs

Package last updated on 20 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts