Registry / devops / adonis-cache

adonis-cache

JSON →
library0.3.4jsnpmunverified

Cache provider for AdonisJS framework (v0.3.4). Provides a unified API for multiple caching backends (object, database, Redis). Includes migration generation and Ace commands. This package is unmaintained since 2019 and not compatible with AdonisJS v5+. For newer versions, use @adonisjs/cache or other alternatives.

npm install adonis-cache
INSTALL
IMPORT
SIG · ADONIS-CACHE
A
adonis-cache
devopsjavascriptv0.3.4
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
const Cache = use('Cache')
import Cache from 'adonis-cache'
AdonisJS uses the global use() function, not ES import. Must register alias in start/app.js.
CacheProvider
'adonis-cache/providers/CacheProvider'
adonis-cache/providers/CacheProvider
Used in providers array in start/app.js as a string.
CommandsProvider
'adonis-cache/providers/CommandsProvider'
adonis-cache/providers/CommandsProvider
Used in aceProviders array in start/app.js.

Registers the cache provider and command provider, then uses the Cache facade to store and retrieve a simple key-value.

// start/app.js const providers = [ '@adonisjs/framework/providers/AppProvider', '@adonisjs/framework/providers/ViewProvider', 'adonis-cache/providers/CacheProvider' ] const aceProviders = [ '@adonisjs/framework/providers/CommandProvider', 'adonis-cache/providers/CommandsProvider' ] const aliases = { Cache: 'Adonis/Addons/Cache' } // Then run: adonis cache:config // Usage in controller: const Cache = use('Cache') async index() { await Cache.put('key', 'value', 3600) const val = await Cache.get('key') return val }
Debug
Known issues
breakingPackage is unmaintained since 2019; no AdonisJS v5 support.
fix
Use @adonisjs/cache or switch to AdonisJS v4 with this package.
affects: >=0.0.0
deprecatedRequires AdonisJS v4; not compatible with AdonisJS v5 due to framework changes.
fix
Upgrade to AdonisJS v5 and use official caching solutions.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'adonis-cache/providers/CacheProvider'
Package not installed or not listed in package.json
fix
Run npm install adonis-cache --save and ensure providers array in start/app.js matches the installed version.
TypeError: Cache.get is not a function
Alias not registered or use() not working due to incorrect namespace
fix
Add Cache: 'Adonis/Addons/Cache' to aliases in start/app.js and restart the application.
Upgrade
Version history
0.3.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
38 hits · last 30 days
node
34
Amazon
1
OpenAI (training)
1
Resources
adonis-cache — npm install adonis-cache · libregistry