
Security News
Inside Lodash’s Security Reset and Maintenance Reboot
Lodash 4.17.23 marks a security reset, with maintainers rebuilding governance and infrastructure to support long-term, sustainable maintenance.
@bondsports/cache
Advanced tools
Cache is a module to encapsulate generic caching functionality under simple interface
It provides two interfaces BaseCache and SimpleCache
Both were designed to be used to cache plain javascript objects containing id:number field for identification
BaseCache is a low level one to have more control over the process.
SimpleCache is better suited if you want to have separate cache holders for different kind of objects
BaseCache
import { BaseCache, MemoryStore } from '@bondsports/cache';
const cache = new BaseCache(new MemoryStore(), console.log, true);
const program = cache.getOrFetchOne('programs', 12, async missingId => ({ id: 12, name: 'program 12' }));
const programs = cache.getOrFetch('programs', [12, 13], async missingIds => [
{ id: 12, name: 'program 12' },
{ id: 13, name: 'program 13' },
]);
cache.invalidateOne('programs', 12);
cache.invalidate('programs', [13]);
SimpleCache
import { BaseCache, MemoryStore } from '@bondsports/cache';
const cache = new SimpleCache(new MemoryStore(), 'programs', async missingIds => [
{ id: 12, name: 'program 12' },
{ id: 13, name: 'program 13' },
]);
const program = cache.getOrFetchOne(12);
const programs = cache.getOrFetch([12, 13]);
cache.invalidateOne(12);
cache.invalidateAll();
SimpleCache with Redis as a store
import { RedisClientType, createClient } from '@redis/client';
import { RedisStore } from '@bondsports/cache';
const client = createClient({ url: 'redis://localhost:6379' });
const store = new RedisStore(client, 1000);
const cache = new SimpleCache(store, 'programs', async missingIds => [
{ id: 12, name: 'program 12' },
{ id: 13, name: 'program 13' },
]);
const program = cache.getOrFetchOne(12);
const programs = cache.getOrFetch([12, 13]);
cache.invalidateAll();
SimpleCache with Redis as a store
import { RedisClientType, createClient } from '@redis/client';
import { RedisStore } from '@bondsports/cache';
const client = createClient({ url: 'redis://localhost:6379' });
const store = new RedisStore(client, 1000);
const cache = new SimpleCache(store, 'programs', async missingIds => [
{ id: 12, name: 'program 12' },
{ id: 13, name: 'program 13' },
]);
const program = cache.getOrFetchOne(12);
const programs = cache.getOrFetch([12, 13]);
FAQs
Cache module for Bond-Sports
The npm package @bondsports/cache receives a total of 724 weekly downloads. As such, @bondsports/cache popularity was classified as not popular.
We found that @bondsports/cache demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Lodash 4.17.23 marks a security reset, with maintainers rebuilding governance and infrastructure to support long-term, sustainable maintenance.

Security News
n8n led JavaScript Rising Stars 2025 by a wide margin, with workflow platforms seeing the largest growth across categories.

Security News
The U.S. government is rolling back software supply chain mandates, shifting from mandatory SBOMs and attestations to a risk-based approach.