Registry / storage / deep-cache

deep-cache

JSON →
library1.12.11jsnpmunverified

DEEP Cache Library (deep-cache) is part of the DEEP Framework, a full-stack web framework for building cloud-native serverless applications on AWS. Version 1.12.11 is the latest stable release; the project appears to be in maintenance mode with no recent updates. It provides an abstracted caching layer that works with AWS services like DynamoDB and ElastiCache, aiming to simplify serverless development. Compared to other caching solutions, it is tightly coupled to the DEEP ecosystem and AWS, and not recommended for general use outside that context.

npm install deep-cache
INSTALL
IMPORT
SIG · DEEP-CACHE
D
deep-cache
storagejavascriptv1.12.11
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.

Cache
import { Cache } from 'deep-cache'
const Cache = require('deep-cache').Cache
ESM import is preferred; CommonJS require works but may not be tree-shakeable.
CacheProvider
import { CacheProvider } from 'deep-cache'
import CacheProvider from 'deep-cache'
CacheProvider is a named export, not default.
DynamoDBCache
import { DynamoDBCache } from 'deep-cache'
const { DynamoDBCache } = require('deep-cache')
Both named import and destructured require are valid, but ESM is recommended.

Demonstrates creating a DynamoDB-backed cache instance, setting and getting a value with a TTL.

import { Cache } from 'deep-cache'; const cache = new Cache({ provider: 'dynamodb', tableName: 'myCacheTable', region: 'us-east-1', accessKeyId: process.env.AWS_ACCESS_KEY_ID ?? '', secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY ?? '' }); async function run() { await cache.set('myKey', { data: 'hello' }, 3600); const value = await cache.get('myKey'); console.log(value); } run().catch(console.error);
Debug
Known issues
deprecatedDEEP Framework and its packages like deep-cache are no longer actively maintained.
fix
Consider migrating to standalone caching solutions like ioredis or @aws-sdk/client-dynamodb.
affects: >=1.0.0
gotchaRequires AWS credentials and DynamoDB table to be pre-configured; no fallback local cache.
fix
Ensure AWS credentials are available and the DynamoDB table exists before using.
affects: >=1.0.0
breakingVersion 1.12.0 changed the provider configuration format; older configs break.
fix
Update cache constructor to use new provider object format (see docs).
affects: <1.12.0
gotchaCache keys are automatically prefixed; this can cause unexpected misses if not accounted for.
fix
Use the getPrefixedKey() method or rely on default behavior for consistency.
affects: >=1.0.0
deprecatedThe package depends on deprecated AWS SDK v2; future compatibility issues expected.
fix
Migrate to AWS SDK v3 alternatives or use a different caching library.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cache provider not configured
Cache constructor called without a provider property in options.
fix
Pass a provider object with a 'provider' key (e.g., { provider: 'dynamodb' }).
ValidationException: The provided key element does not match the schema
Cache key format doesn't match DynamoDB table schema (hash key name mismatch).
fix
Ensure the table has a hash key named 'pk' (or configure via options) and the key is a string.
CredentialsError: Missing credentials in config
AWS credentials not set in environment or default config.
fix
Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables, or configure ~/.aws/credentials.
TypeError: cache.get is not a function
Attempting to call get() after cache failed to initialize (e.g., missing provider).
fix
Check cache initialization and ensure provider is correctly set before usage.
Upgrade
Version history
1.12.11latest on npm
Audit
Dependencies
deep-coreoptionalCore framework dependency for DEEP-based projects
Agent activity
33 hits · last 30 days
node
28
Amazon
1
OpenAI (training)
1
Resources