Class

NodeCacheAdapter

NodeCacheAdapter(optionsopt)

Constructor

# new NodeCacheAdapter(optionsopt)

Parameters:
Name Type Attributes Default Description
options Object <optional>
stdTTL number <optional>
60

Default TTL (seconds)

checkperiod number <optional>
120

How often to check for expired keys (seconds)

View Source src/common/cache/adapters/NodeCacheAdapter.js, line 18

Methods

# async close() → {Promise.<boolean>}

Close the cache.

View Source src/common/cache/adapters/NodeCacheAdapter.js, line 96

Promise.<boolean>

# async del(key) → {Promise.<boolean>}

Delete a specific key.

Parameters:
Name Type Description
key string

View Source src/common/cache/adapters/NodeCacheAdapter.js, line 75

Promise.<boolean>

# async get(key, ctxopt) → {Promise.<*>}

Get a value by key and rehydrate into Entity instances (if context provided).

Parameters:
Name Type Attributes Description
key string
ctx Object <optional>
repository Object <optional>

Repository with wrapEntity()

entityClass function <optional>

Entity class constructor

View Source src/common/cache/adapters/NodeCacheAdapter.js, line 34

Promise.<*>

# async invalidatePrefix(prefix) → {Promise.<boolean>}

Invalidate all keys that start with the given prefix.

Parameters:
Name Type Description
prefix string

View Source src/common/cache/adapters/NodeCacheAdapter.js, line 85

Promise.<boolean>

# async set(key, value, ttlSecondsopt, ctxopt) → {Promise.<boolean>}

Set a value by key. Stores as-is (entities are kept intact).

Parameters:
Name Type Attributes Description
key string
value *
ttlSeconds number <optional>

Optional TTL override (seconds)

ctx Object <optional>

Unused for Node adapter

View Source src/common/cache/adapters/NodeCacheAdapter.js, line 64

Promise.<boolean>