Registry / storage / cache-istos

cache-istos

JSON →
library1.0.6jsnpmunverified

A lightweight in-memory key-value cache with automatic eviction, inspired by Unix page-stealing. Stores references with a configurable TTL; entries are marked and stolen after 1–2 TTL cycles if not accessed. Types included. Current version 1.0.6, maintained by habibouldmoussa. Simple API (set, get, delete, destroy). Differentiator: automatic eviction without manual cleanup, suitable for ephemeral data.

npm install cache-istos
INSTALL
IMPORT
SIG · CACHE-ISTOS
C
cache-istos
storagejavascriptv1.0.6
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.

Stealer
import { Stealer } from '@habibouldmoussa/cache_istos'
import { Stealer } from 'cache-istos'
Package scoped under @habibouldmoussa; types are included.
Stealer
import { Stealer } from '@habibouldmoussa/cache_istos'
const { Stealer } = require('@habibouldmoussa/cache_istos')
ESM-first package; CommonJS require may not work without build step.
default
import Stealer from '@habibouldmoussa/cache_istos'
import { default as Stealer } from '@habibouldmoussa/cache_istos'
Package exports a default export of the Stealer class.

Shows basic usage: instantiate with TTL, set/get/delete values, and clean up.

import Stealer from '@habibouldmoussa/cache_istos'; const cache = new Stealer({ ttl: 2, unref: true }); cache.set('user', { name: 'Alice' }); const user = cache.get('user'); console.log(user); // { name: 'Alice' } cache.delete('user'); cache.destroy();
Debug
Known issues
gotchaStealer task does not stop automatically unless `unref: true` is set
fix
Set `unref: true` in options or call `stealer.destroy()` explicitly.
affects: >=1.0.0
gotchaget() returns `undefined` for expired or stolen keys
fix
Always check if the returned value is undefined before using it.
affects: >=1.0.0
gotchaCache eviction is asynchronous; entries may persist slightly beyond TTL
fix
Design your application to tolerate eventual consistency of cache eviction.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module '@habibouldmoussa/cache_istos'
Missing package installation
fix
npm install @habibouldmoussa/cache_istos
TypeError: Stealer is not a constructor
Using default import incorrectly or importing a non-existent named export
fix
Use default import: import Stealer from '@habibouldmoussa/cache_istos'
ReferenceError: Stealer is not defined
Package not installed or import statement missing
fix
Ensure package is installed and you have the correct import statement
Upgrade
Version history
1.0.6latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
33 hits · last 30 days
node
30
OpenAI (training)
1
Resources
cache-istos — npm install cache-istos · libregistry