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

@n8io/baseline-cache

Latest version: v6.4.2

Overview

Last scanned
28 Nov 2026
Published
28 Nov 2026
npm package Publisher: n8io
0 Stars
0 Forks
15 Versions
5.5K Downloads
TypeScript Repo language

Scan summary

@n8io/baseline-cache was last scanned on 28 Nov 2026 at version 6.4.2. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 15 versions; the latest 3 were published within 3 days (26–28 Nov 2026).
  • Findings: No rules fired in version 6.4.2.
  • Downloads: 5,546 downloads.

Versions

15 versions published
Versions and the rules that fired in each
VersionPublishedStatus
6.4.2 LATEST 28 Nov 2026 No rules fired
6.4.1 27 Nov 2026 No rules fired
6.4.0 26 Nov 2026 No rules fired
6.3.1 21 Nov 2026 Not shown
6.3.0 20 Nov 2026 Not shown

No rules fired in 6.4.2

Findings

Findings for v6.4.2. 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 6.4.2; other versions have their own rules, not their own score.

README

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

@n8io/baseline-cache

A typed cache that, by default, never takes your Project down with it. Every read is checked by the schema you give it, an entry in an older shape reads as a miss, and a store that fails reads as a miss too.

pnpm add @n8io/baseline-cache

Guarantees

You get How
Typed reads Each get runs the stored JSON through your schema; the cache's type is the schema's output.
Old entries are misses, not crashes A value the schema refuses, such as one an older version of your Project wrote, reads as undefined.
Any schema library Any Standard Schema: a Zod, Valibot or ArkType schema goes in as it is. The Package imports none.
Up while the store is down By default get misses and set and delete resolve. Each failure counts on baseline.cache.store_errors, with one warning log per 30 s per cache.
This process never serves what it tried to replace By default, after a failed set or delete this process reads that id as a miss for ttlMs. Other processes may still serve the old entry until it expires.
Bounded staleness Entries expire after ttlMs, 60 s by default.
One store, many caches Open one CacheStore per process; keys are <prefix>:<id>. Swapping the backend touches one file.

Example

import { cacheCreate } from "@n8io/baseline-cache";
import { z } from "zod";

const Foo = z.object({ createdAt: z.coerce.date(), name: z.string() });

const fooCache = cacheCreate(cacheStore, {
    prefix: "foo",
    schema: Foo,
    ttlMs: 30_000,
});

await fooCache.set(foo.id, foo);
const cached = await fooCache.get(foo.id); // the Foo, or undefined

Entries are JSON, so a Date comes back as a string: z.coerce.date() turns it back, or every read would be a miss. In unit tests build the cache on cacheStoreMemoryCreate(). It stores JSON as the Redis store does. To test expiry, give the cache a short ttlMs and wait. The Package's own pnpm test needs Docker for Redis; pnpm test:unit runs the tests that need no Redis.

Reference

Export Does
cacheCreate(store, options), CacheOptions, CacheKeyedOptions, Cache<T>, CacheKeyed<T> A cache on a store, from { prefix, schema, keyOf?, ttlMs?, onStoreError? } (CacheKeyedOptions when keyOf is given, else CacheOptions). Keys are <prefix>:<id> and entries expire after ttlMs (default 60 s). schema is any Standard Schema: a Zod, Valibot or ArkType schema goes in as it is. A stored value that fails the schema reads as a miss. It keeps working when the store does not: see "When the store is down". Throws TypeError on a ttlMs that is not a positive integer, an empty prefix or an unknown onStoreError. Returns a Cache<T>: get(id), set(id, value) and delete(id); with keyOf: (value) => id, for values that carry their own id, a CacheKeyed<T>, the same but set(value) takes the value alone.
CacheStore Where entries live, as JSON strings by key with a TTL. Open one per process and build every cache on it; a new backend is one more CacheStore.
cacheStoreRedisCreate({ redisClient }), CacheStoreRedisOptions A store on a connected node-redis client. Each call fails after 1 s without an answer, which the cache on top treats like any other store failure.
cacheStoreMemoryCreate() A store in process, for unit tests and memory://. Caches on one store share its keys, as on Redis, so give each its own prefix.

Pick the store in one place, and name no backend anywhere else:

// src/cache-store-open.ts: the only file that knows the backend
import {
    cacheStoreMemoryCreate,
    cacheStoreRedisCreate,
} from "@n8io/baseline-cache";
import type { RedisClient } from "@n8io/baseline-redis";

export const cacheStoreOpen = ({ redis }: { redis: RedisClient | "memory" }) =>
    redis === "memory"
        ? cacheStoreMemoryCreate()
        : cacheStoreRedisCreate({ redisClient: redis });

The cache's value type is the schema's output: the Example's Foo gives a Cache<{ createdAt: Date; name: string }>, so get returns that or undefined. The Package does not import Zod. Any Standard Schema works the same way, for example Valibot's v.object({ name: v.string() }).

A cache is an optimization, so by default a store that fails or times out never fails the caller:

  • get is a miss, so the caller reads the source of truth.
  • set and delete resolve.
  • Every failure is counted on baseline.cache.store_errors (by baseline.cache.operation and baseline.cache.prefix), and logged as one warning per 30 s per cache, so you can alert on an outage without a log line per call.

A set or delete that fails leaves the old entry in the store. The process that called it remembers the id for ttlMs and reads it as a miss, so it never serves the value it tried to replace. Other processes may.

Pass onStoreError: "throw" to get the store's error from every call instead, for a value you would rather fail on than read without the cache.

The cache does not see writes to the source of truth: you delete (or set) after each one. When that call is lost (the store is down, or the process dies between the commit and the call), other processes can serve the old value until its entry expires: at most ttlMs, 60 s by default. For a value that cannot be that stale, shorten ttlMs or do not cache it.

By the Template's convention: CACHE_URL (redis:// or rediss://, or memory:// for the memory store). You bring the schema library (the Template uses Zod), and the Redis store takes the client you pass it, so the Package needs neither zod nor redis.

pnpm test:mutation runs Stryker over src/cache.ts and src/cache-store-memory.ts with the unit tests (vitest.mutation.config.ts leaves out the Redis ones, which need Docker) and fails below a floor of 90%. The score today is 94.74% (108 killed, 5 survived, 1 not covered of 114 mutants). All six are equivalent: the sweep of expired marks in staleMark only frees memory (a mark that has ended already reads as a miss), and the catch in cacheJsonParse returns undefined either way. Raise the floor as tests allow; never lower it to pass. It is not in CI yet.

Needs peer @opentelemetry/api for the counter (it does nothing until your Project registers a meter provider); CACHE_URL by the Template's convention. Runs on Redis (any connected node-redis client, such as @n8io/baseline-redis's) or in memory.

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 @n8io/baseline-cache

References

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

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

Microsoft's Official agent framework Hijacked
AI & VibeSec

BREAKING: Hijacked Releases of Microsoft’s Official agent-framework Steals Azure and CI Credentials

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?

Frame 2085668439 (1)
Group 1261154229