Registry / storage / feather-cache

feather-cache

JSON →
library1.3.1jsnpmunverified

feather-cache v1.3.1 is a lightweight pluggable key-value cache supporting multiple storage backends (in-memory, MongoDB, IndexedDB). Released under MIT license with low release cadence (last update ~2019). It differentiates from simpler caches like lru-cache by allowing custom drivers for persistent storage. Built-in TypeScript types. The in-memory driver is for convenience; for serious in-memory caching, lru-cache is recommended. Supports async get/set/delete with optional TTL per key.

npm install feather-cache
INSTALL
IMPORT
SIG · FEATHER-CACHE
F
feather-cache
storagejavascriptv1.3.1
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.

FeatherCache
import { FeatherCache } from 'feather-cache'
import FeatherCache from 'feather-cache'
FeatherCache is a named export, not default.
FeatherCache
const { FeatherCache } = require('feather-cache')
const FeatherCache = require('feather-cache')
CommonJS require must destructure the named export.
FeatherCacheOptions
import type { FeatherCacheOptions } from 'feather-cache'
import { FeatherCacheOptions } from 'feather-cache'
FeatherCacheOptions is a type; use type import in TypeScript.

Demonstrates in-memory cache with set, get, fetch, and delete operations.

import { FeatherCache } from 'feather-cache'; const cache = new FeatherCache({ maxAgeInMs: 60000 }); async function main() { await cache.set('greeting', 'Hello, World!'); const value = await cache.get('greeting'); console.log(value); // 'Hello, World!' const result = await cache.fetch('greeting'); console.log(result); // { key: 'greeting', val: 'Hello, World!' } await cache.del('greeting'); console.log(await cache.get('greeting')); // null } main().catch(console.error);
Debug
Known issues
gotchaIn-memory cache is for convenience only; not designed for high-performance in-memory caching.
fix
Use lru-cache if you need a robust in-memory cache.
affects: >=1.0.0
deprecatedThe library has not been updated since 2019; may have compatibility issues with newer Node versions.
fix
Consider alternatives like lru-cache instead.
affects: >=1.3.0
breakingThe `fetch` method returns an object { key, val } instead of just the value.
fix
Use `cache.get(key)` if you only need the value.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: FeatherCache is not a constructor
Using default import instead of named import.
fix
Change to: import { FeatherCache } from 'feather-cache'
Cannot find module 'feather-cache' or its corresponding type declarations.
TypeScript strict mode without proper import syntax.
fix
Ensure you are using: import { FeatherCache } from 'feather-cache'
Upgrade
Version history
1.3.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
29 hits · last 30 days
node
28
Resources
feather-cache — npm install feather-cache · libregistry