Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@open-mercato/cache

Latest version: v0.11.1-develop.8477.1.a433fc7e8d

Overview

Last scanned
23 Nov 2026
Published
23 Nov 2026
npm package Publisher: pat-lewczuk, patryk.andrzejewski, piotrkarwatka
1,957 Stars
500 Forks
135 Versions
129.1K Downloads
TypeScript Repo language

Scan summary

@open-mercato/cache was last scanned on 23 Nov 2026 at version 0.11.1-develop.8477.1.a433fc7e8d. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 135 versions; the latest 5 were published on 23 Nov 2026.
  • Findings: No rules fired in version 0.11.1-develop.8477.1.a433fc7e8d.
  • Downloads: 129,119 downloads.

Versions

135 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.11.1-develop.8477.1.a433fc7e8d LATEST 23 Nov 2026 No rules fired
0.11.1-develop.8473.1.9f90793385 23 Nov 2026 No rules fired
0.11.1-develop.8464.1.b5786bcf1c 23 Nov 2026 Not shown
0.11.1-develop.8463.1.fc649816ca 23 Nov 2026 Not shown
0.11.1-develop.8462.1.d65a909e61 23 Nov 2026 Not shown

No rules fired in 0.11.1-develop.8477.1.a433fc7e8d

Findings

Findings for v0.11.1-develop.8477.1.a433fc7e8d. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.11.1-develop.8477.1.a433fc7e8d; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

@open-mercato/cache

Tag-aware, strategy-pluggable cache service extracted from the Open Mercato platform—now packaged for general-purpose Node.js apps.

  • 🔁 Swappable storage engines: in-memory, Redis, SQLite, or JSON-file without touching your call-sites.
  • 🏷️ Tag-based invalidation: expire related keys with one operation (deleteByTags).
  • ⏱️ TTL + stats tooling: per-entry TTLs, wildcard key lookups, stats, and cleanup helpers.
  • 🧩 DI friendly: use the functional factory or the CacheService class.
  • 🧾 Pure TypeScript: strict typings + generated declaration files (emitted to dist/).
  • 🪶 Zero hard deps: optional peers (ioredis, better-sqlite3) only when you activate those strategies.

Installation

yarn add @open-mercato/cache

# add peers when needed
yarn add ioredis           # for the Redis strategy
yarn add better-sqlite3    # for the SQLite strategy

Runtime: Node 18+. The library is compiled with the repo’s root tsconfig and ships JS + d.ts files in dist/.


Quick start

import { createCacheService } from '@open-mercato/cache'

const cache = createCacheService({
  strategy: process.env.CACHE_STRATEGY || 'memory',
  redisUrl: process.env.CACHE_REDIS_URL,
  sqlitePath: './.mercato/cache/cache.db',
  jsonFilePath: './.mercato/cache/cache.json',
  defaultTtl: 5 * 60_000,
})

await cache.set('user:123', { name: 'Ada' }, { ttl: 10 * 60_000, tags: ['users', 'user:123'] })

const result = await cache.get('user:123')
await cache.deleteByTags(['users']) // bust related entries
await cache.cleanup()               // sweep expired rows (mainly for sqlite/json)
await cache.close()                 // dispose connections on shutdown

Strategy matrix

Strategy Persistence Concurrency Extra deps Typical use case
memory ❌ process single node – Unit tests, light CLIs, temporary caches
redis ✅ external multi-node ioredis Horizontal APIs, queues, distributed workers
sqlite ✅ local single node better-sqlite3 Edge workers, self-hosted admin tooling
jsonfile ✅ local single node – Debugging snapshots, very small deployments

The SQLite strategy opens its database in WAL mode with synchronous=NORMAL, which is appropriate for cache data that can be regenerated after a crash. Use Redis for multi-process deployments or latency-sensitive request paths that perform many cache writes per request.

Switch the strategy via:

  • CACHE_STRATEGY env var (memory default), or
  • Passing strategy, redisUrl, sqlitePath, jsonFilePath to createCacheService.

Configuration

Environment variables
CACHE_STRATEGY=memory|redis|sqlite|jsonfile
CACHE_TTL=300000
CACHE_REDIS_URL=redis://localhost:6379
CACHE_SQLITE_PATH=./.mercato/cache/cache.db
CACHE_JSON_FILE_PATH=./.mercato/cache/cache.json
Programmatic
const sqliteCache = createCacheService({
  strategy: 'sqlite',
  sqlitePath: './.mercato/cache/cache.db',
  defaultTtl: 30 * 60_000,
})

API reference (all strategies implement these)

Method Description
get(key, { returnExpired? }) Retrieves a value, optionally returning expired records for debugging.
set(key, value, { ttl?, tags? }) Stores a value with a TTL and tag metadata.
has(key) Boolean existence check (ignores expired rows).
delete(key) Removes a single key.
deleteByTags(tags[]) Removes every entry that matches any of the provided tags.
clear() Clears the current scope (all tenant-prefixed entries when used inside Open Mercato).
keys(pattern?) Lists logical keys using glob syntax (*, ?).
stats() Returns { size, expired } counters.
cleanup() Sweeps expired entries (primarily for sqlite/json backends).
close() Disposes the underlying client (important for Redis).

Prefer the functional factory (createCacheService) for most cases. If you need to integrate with Awilix or another DI container, use the CacheService class wrapper—its public methods mirror the table above.


Advanced usage

Tag-based invalidation
await cache.set(`product:${id}`, payload, {
  tags: ['products', `catalog:${catalogId}`, `product:${id}`],
})

// Later…
await cache.deleteByTags([`catalog:${catalogId}`]) // bust only that catalog

Tags behave like sets. A single delete request can invalidate thousands of keys without scanning the entire store, which keeps admin actions and background jobs snappy.

Pattern matching & diagnostics
const staleKeys = await cache.keys('report:*:2024-*')
const stats = await cache.stats()

console.log(`Cache size: ${stats.size}, expired entries waiting: ${stats.expired}`)

The glob-matching happens on logical keys, so you can keep friendly names for troubleshooting while the implementation hashes/filters keys under the hood.


Building & publishing

This package lives inside the monorepo but publishes independently. The emitted JS and declaration files live in dist/ (ignored by git).

# Install dependencies at the repo root
yarn install

# Build the cache package
npx tsc -p packages/cache/tsconfig.build.json

# Run the targeted test suite (optional)
npm run test -- --runTestsByPath packages/cache/src/__tests__/service.test.ts

# Inspect the tarball before publishing
cd packages/cache
npm pack

# Publish
npm publish --access public

The package.json already points main/types at dist/index.*, so consumers always receive compiled artifacts.


Contributing

  1. Edit the TypeScript sources in packages/cache/src.
  2. Run the focused Jest suite (npm run test -- --runTestsByPath packages/cache/src/__tests__/service.test.ts).
  3. Rebuild (npx tsc -p packages/cache/tsconfig.build.json) to refresh dist/.
  4. Open a PR and describe the strategy/feature you touched.

Bug reports & feature requests: open an issue in the main Open Mercato repository and tag it with cache.


License

MIT © Open Mercato

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @open-mercato/cache

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

Copy of Template Design OX Blog (3)
Research

Ruby2Shell: Ruby Memory Corruption Flaws Expose Applications to Remote Code Execution, But is it an Actual Risk?

Critical Apache HTTP Server Flaw Exposes Web Servers to RCE (1)
CVE

CVE-2026-119618: Critical Apache HTTP Server Flaw Exposes Web Servers to Remote Code Execution

Frame 2085668439 (1)
Group 1261154229