Registry / database / aragami

aragami

JSON →
library1.2.12jsnpmunverified

Aragami is a cache ORM for Node.js that provides decorator-based caching, locking, and CRUD operations with TypeScript support. Current stable version is 1.2.12. It offers an intuitive API using decorators like @CachePrefix, @CacheTTL, @CacheKey, and @LockKey to manage caching on class instances. Key differentiators include built-in distributed locking, redis support, and cache-aside pattern via wrap/useLock utilities. Release cadence is low; the package has not been updated recently. Ideal for projects needing simple, decorator-driven caching with ORM-like semantics.

npm install aragami
INSTALL
IMPORT
SIG · ARAGAMI
A
aragami
databasejavascriptv1.2.12
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Aragami
import { Aragami } from 'aragami'
const Aragami = require('aragami')
ESM-only package; default import is not available, use named import.
CachePrefix
import { CachePrefix } from 'aragami'
import { CachePrefix } from 'aragami/decorators'
All decorators are exported from the main package entry.
CacheKey
import { CacheKey } from 'aragami'
import { CacheKey } from 'aragami/cache'
No subpath exports; all exports are from 'aragami'.
LockKey
import { LockKey } from 'aragami'
import { LockKey } from 'aragami/lock'
LockKey decorator is exported from the main package.

Shows basic usage of Aragami with Redis, a decorated User class, and set/get/delete operations.

import { Aragami, CachePrefix, CacheTTL, CacheKey, LockKey } from 'aragami'; const aragami = new Aragami({ redis: { url: process.env.REDIS_URL ?? 'redis://localhost:6379' }, }); @CachePrefix('user') @CacheTTL(30000) class User { @CacheKey() @LockKey() name: string; @LockKey() age: string; } async function main() { const user = new User(); user.name = 'John'; user.age = '30'; await aragami.set(user); const cached = await aragami.get(User, 'John'); console.log(cached); await aragami.delete(user); } main().catch(console.error);
Debug
Known issues
gotchaCacheKey decorator is required on at least one field; otherwise set() silently fails to cache.
fix
Always add @CacheKey() to a unique identifier field in your class.
affects: *
gotchaWhen using Redis, the connection is not closed automatically; calling process.exit() may drop pending operations.
fix
Gracefully shutdown the Aragami instance with aragami.disconnect() before exiting.
affects: *
gotcha@LockKey decorator alone does not provide locking; you must use aragami.lock() or aragami.useLock().
fix
Use aragami.lock() or aragami.useLock() to acquire locks based on @LockKey fields.
affects: *
Errors
Common errors & fixes
TypeError: aragami.set is not a function
Forgetting to instantiate Aragami or using default import incorrectly.
fix
Use named import: import { Aragami } from 'aragami' and create instance: const aragami = new Aragami();
Redis connection refused - connect ECONNREFUSED 127.0.0.1:6379
Redis server is not running or specified url is wrong.
fix
Start Redis server or set redis.url to a valid Redis instance.
argami.cache is not a function
Typo in method name; method is called 'cache' but spelled 'argami'.
fix
Correct the method name: aragami.cache(User, 'John', () => database.get('John'));
Upgrade
Version history
1.2.12latest on npm
Audit
Dependencies
ioredisoptionalRequired for Redis store backend; only needed if 'redis' option is provided to Aragami constructor.
Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
1
Resources
aragami — npm install aragami · libregistry