
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
zephyr-native-cache
Advanced tools
Zephyr Cloud | Zephyr Docs | Discord | Twitter | LinkedIn
A React Native native cache layer for Module Federation Metro bundles. It verifies bundle hashes, caches validated bundles on device, and supports background polling for updates.
# npm
npm install zephyr-native-cache
# yarn
yarn add zephyr-native-cache
# pnpm
pnpm add zephyr-native-cache
# bun
bun add zephyr-native-cache
Configure the Module Federation runtime plugin in your Metro MF setup:
runtimePlugins: [require.resolve('zephyr-native-cache/runtime-plugin')];
Register the cache once at app startup before loading remotes:
import { register } from 'zephyr-native-cache';
register({
maxCacheSizeBytes: 50 * 1024 * 1024,
maxAgeMs: 3 * 24 * 60 * 60 * 1000,
enablePolling: true,
pollIntervalMs: 10 * 60 * 1000,
});
register(config) accepts:
bundleDir: custom storage directory for cached bundlesmaxCacheSizeBytes: max cache size before LRU eviction (default 20MB)maxAgeMs: stale threshold for cache entries (default 7 days)minCacheSizeBytes: minimum cache size to preserve during cleanupenablePolling: start automatic manifest polling (default true)pollIntervalMs: polling interval in ms (default 5 minutes)forceCacheInDev: enable cache in development mode (production is always enabled)register returns a BundleCacheLayer instance:
loadBundle(bundleUrl)checkForUpdates()startPolling(intervalMs?)stopPolling()clearCache()getLoadedBundles()It also exposes globals for manual control:
globalThis.__MFE_CHECK_UPDATES__()globalThis.__MFE_START_UPDATE_POLLING__(intervalMs?)globalThis.__MFE_STOP_UPDATE_POLLING__()Use CacheEvents to observe cache lifecycle events:
bundle:loadpoll:startupdate:availableupdate:downloadedpoll:completeExample:
import { register } from 'zephyr-native-cache';
const cache = register();
cache.events.on('bundle:load', (event) => {
console.log('[cache]', event.status, event.remoteName);
});
cache.events.on('poll:complete', (event) => {
console.log('[cache] poll complete', event.updated, '/', event.checked);
});
>=19.0.0>=0.79.0Licensed under the Apache-2.0 License. See LICENSE for more information.
FAQs
Native caching module for Module Federation Metro bundles
The npm package zephyr-native-cache receives a total of 0 weekly downloads. As such, zephyr-native-cache popularity was classified as not popular.
We found that zephyr-native-cache demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.