A cache provider for AdonisJS v5+ with file-based storage and TTL support. Current version 2.0 provides ESM-only exports and TypeScript types. Released as needed. Differentiates by being a native Laravel-style cache for AdonisJS, integrating seamlessly with the framework's IoC container. Supports cache tags and cache events.
npm install adonisjs-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to configure, import, and use CacheManager in an AdonisJS controller with TTL.
Use ES import syntax. Ensure node --experimental-specifier-resolution=node is set if needed.
Use the new provider-based configuration via .env or environment variables. See migration guide.
Configure a persistent store like Redis or set cache to use a non-volatile directory.
Use scoped cache keys or custom logic to mimic tags.
Check for null if you rely on falsy equality checks.
Change const cache = require('adonisjs-cache') to import cache from 'adonisjs-cache'Ensure AdonisJS project setup with @adonisjs/core installed. Run 'npm install @adonisjs/core'.
Use correct import path: 'adonisjs-cache/services/cache' without extension. Ensure TypeScript moduleResolution set to 'node'.
Use import cache from 'adonisjs-cache/services/cache'.