Modules@robinpath/storage

@robinpath/storage

0.1.0Public

Persistent key-value and file storage for workflow state

@robinpath/storage

Persistent key-value storage (memory or file-backed) with TTL, counters, and file operations

Category Functions Auth License

Why use this module?

The storage module lets you:

  • Create a named key-value store (memory or file-backed)
  • Get a value by key
  • Check if a key exists
  • Remove a key
  • List all keys, optionally filtered by pattern

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

Installation

npm install @robinpath/storage

Quick Start

No credentials needed — start using it right away:

storage.set "state" "lastRun" $timestamp

Available Functions

FunctionDescription
storage.createCreate a named key-value store (memory or file-backed)
storage.setSet a key-value pair with optional TTL
storage.getGet a value by key
storage.hasCheck if a key exists
storage.removeRemove a key
storage.keysList all keys, optionally filtered by pattern
storage.valuesGet all key-value pairs
storage.sizeGet number of entries
storage.clearRemove all entries
storage.incrementIncrement a numeric value
storage.decrementDecrement a numeric value
storage.getAllGet all data as a plain object
storage.setManySet multiple key-value pairs at once
storage.destroyDestroy a store and delete its file if file-backed
storage.saveFileSave content to a file on disk
storage.loadFileLoad a file from disk
storage.listFilesList files in a directory
storage.deleteFileDelete a file from disk

Examples

Set a key-value pair with optional TTL

storage.set "state" "lastRun" $timestamp

Get a value by key

storage.get "state" "lastRun"

Check if a key exists

storage.has "state" "lastRun"

Integration with RobinPath

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

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

const result = await rp.executeScript(`
  storage.set "state" "lastRun" $timestamp
`);

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/storage
Version0.1.0
LicenseMIT
Unpacked Size6.4 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

Category

devops