A Redis-based caching library v2.1.0 for ONDC (Open Network for Digital Commerce) automation tasks, providing specialized cache services for CRUD operations across multiple databases. It offers per-domain isolation (API, Mock, Reporting, Config, Console) using separate Redis DB indices, with built-in Pub/Sub support. Unlike generic Redis clients, it provides typed service classes for structured caching patterns. Requires a running Redis instance (6.2+ recommended). Ships TypeScript definitions. Active development with regular releases.
npm install ondc-automation-cache-libNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic key-value operations with RedisService and specialized caching using ApiServiceCache, including setup, usage, and cleanup.
Use import { RedisService } from 'ondc-automation-cache-lib'Use separate RedisService instances for concurrent access to different databases, or call useDb() before each operation group.
Always check return values: const result = await RedisService.getKey('key'); if (result === null) { handleError(); }Install redis@3.1.2 or check package.json peerDependencies.
Change to import { RedisService } from 'ondc-automation-cache-lib'Set REDIS_HOST to 'localhost' or your Redis server address, and ensure Redis is running.
Run npm install ondc-automation-cache-lib and use the TypeScript-style import even in .js files (if using Babel), or configure module bundler.