{"id":46526,"library":"steplix-cache","title":"steplix-cache","description":"A Node.js cache helper supporting memory and Redis backends, with an Express middleware inspired by apicache. Version 0.0.5 provides simple async/await caching with optional TTL and environment-based configuration. The library is lightweight but requires external peer dependencies: 'redis' for Redis backend or 'memory-cache' for memory backend. Currently in early development with sporadic releases.","status":"active","version":"0.0.5","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","cache","memory","redis","steplix"],"install":[{"cmd":"npm install steplix-cache","lang":"bash","label":"npm"},{"cmd":"yarn add steplix-cache","lang":"bash","label":"yarn"},{"cmd":"pnpm add steplix-cache","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package does not ship ESM and provides no default export for ESM import. Use require or wrap with createRequire.","wrong":"import cache from 'steplix-cache';","symbol":"cache","correct":"const cache = require('steplix-cache');"},{"note":"Both patterns work, but destructuring is idiomatic. apicache is a named export.","wrong":"const apicache = require('steplix-cache').apicache;","symbol":"apicache","correct":"const { apicache } = require('steplix-cache');"},{"note":"apicache is a function that returns middleware; calling it without arguments uses default duration but must be called.","wrong":"app.use(apicache);","symbol":"cache middleware","correct":"app.use(apicache('1 hour'));"}],"quickstart":{"code":"const cache = require('steplix-cache');\nconst { apicache } = require('steplix-cache');\nconst express = require('express');\n\nasync function example() {\n  // Basic set/get with TTL (optional)\n  await cache.put('key', 'value', 100); // 100ms TTL\n  const val = await cache.get('key');\n  console.log('Cached:', val);\n\n  // Express middleware\n  const app = express();\n  app.use(apicache('5 minutes'));\n  app.get('/', (req, res) => res.json({ ok: true }));\n  app.listen(3000);\n}\nexample().catch(console.error);","lang":"javascript","description":"Shows basic cache set/get with TTL and Express middleware usage using require and async/await."},"warnings":[{"fix":"Install required backend: npm install steplix-cache redis or npm install steplix-cache memory-cache","message":"Must install peer dependency explicitly: 'redis' for Redis backend or 'memory-cache' for memory backend. Package does not install them automatically.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Set environment variable CACHE_TYPE=redis and install redis package.","message":"Cache type defaults to 'memory' if CACHE_TYPE env is not set. To use Redis, ensure CACHE_TYPE=redis and Redis peer dependency installed.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Use require() or create an ESM wrapper with createRequire.","message":"No ESM support; package uses CommonJS require(). Import via ESM requires createRequire or dynamic import.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Pin exact version in package.json and test thoroughly before upgrading.","message":"Version 0.0.5 is very early; API may change without notice. No semver stability.","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"search_vec":"'0.0.5':21 'apicach':19 'async/await':24 'backend':12,46,53 'base':32 'cach':3,6,25,50,62 'configur':33 'current':54 'depend':42 'develop':57 'earli':56 'environ':31 'environment-bas':30 'express':15 'extern':40 'helper':7 'inspir':17 'javascript':61 'librari':35 'lightweight':37 'memori':9,49,52,63 'memory-cach':48 'middlewar':16 'node.js':5 'option':27 'peer':41 'provid':22 'redi':11,43,45,64 'releas':60 'requir':39 'simpl':23 'sporad':59 'steplix':2,65 'steplix-cach':1 'support':8 'ttl':28 'version':20","created_at":"2026-06-07T13:00:21.659263+00:00","updated_at":"2026-06-07T13:00:21.659263+00:00","problems":[{"fix":"npm install redis","cause":"Missing required peer dependency 'redis' when CACHE_TYPE=redis.","error":"Error: Cannot find module 'redis'"},{"fix":"Use require('steplix-cache') instead.","cause":"Using ESM import syntax (import cache from 'steplix-cache') which doesn't return default export.","error":"TypeError: cache.put is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://gitlab.com/steplix/SteplixCache#readme","github":null,"docs":null,"changelog":null,"pypi":null,"npm":"steplix-cache","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}