
Security News
Free Certified Patch for Critical Rails Active Storage Vulnerability
Socket has released a free Certified Patch for a critical Rails Active Storage vulnerability, giving developers time to upgrade to a secure Rails version.
@_all_docs/cache
Advanced tools
Enhanced caching package with cross-runtime HTTP client and advanced cache features.
This package provides:
pnpm add @_all_docs/cache
Cross-runtime HTTP client that works in Node.js and edge environments:
import { BaseHTTPClient, createDispatcher } from '@_all_docs/cache';
// Create client with optional undici dispatcher
const dispatcher = await createDispatcher(env);
const client = new BaseHTTPClient('https://api.example.com', {
dispatcher,
requestTimeout: 30000,
userAgent: 'my-app/1.0'
});
// Make requests
const response = await client.request('/endpoint', {
headers: { 'Accept': 'application/json' }
});
// Use cache validation headers
client.setCacheHeaders(options, cacheEntry);
Manage HTTP cache entries with proper semantics:
import { CacheEntry } from '@_all_docs/cache';
const entry = new CacheEntry(200, {
'content-type': 'application/json',
'cache-control': 'max-age=3600',
'etag': '"abc123"'
});
await entry.setBody({ data: 'value' });
// Check validity
if (entry.valid) {
const data = entry.json();
}
// Verify integrity
const isValid = await entry.verifyIntegrity();
// Encode/decode for storage
const encoded = entry.encode();
const decoded = CacheEntry.decode(encoded);
Advanced cache with pluggable storage backends:
import { Cache } from '@_all_docs/cache';
const cache = new Cache({
path: '/cache/path',
env: { RUNTIME: 'node' },
bloomSize: 10000,
bloomFalsePositiveRate: 0.01
});
// Basic operations
await cache.set('key', { value: 'data' });
const value = await cache.fetch('key');
const exists = await cache.has('key');
await cache.delete('key');
// Iterate over entries
for await (const entry of cache) {
console.log(entry.key, entry.value);
}
// List keys with prefix
for await (const key of cache.keys('prefix:')) {
console.log(key);
}
Generate versioned, cross-platform compatible cache keys:
import {
createPartitionKey,
createPackumentKey,
decodeCacheKey
} from '@_all_docs/cache';
// Partition cache key
const partKey = createPartitionKey('start', 'end', 'https://registry.npmjs.com');
// => "v1:partition:npm:7374617274:656e64"
// Packument cache key
const pkgKey = createPackumentKey('@scope/package', 'https://registry.npmjs.com');
// => "v1:packument:npm:4073636f70652f7061636b616765"
// Decode keys
const decoded = decodeCacheKey(partKey);
// => { version: 'v1', type: 'partition', origin: '...', startKey: 'start', endKey: 'end' }
Track progress of partition set processing:
import { PartitionCheckpoint } from '@_all_docs/cache';
const checkpoint = new PartitionCheckpoint(cache, 'partition-set-id');
// Initialize with partitions
await checkpoint.initialize([
{ startKey: 'a', endKey: 'b' },
{ startKey: 'b', endKey: 'c' }
]);
// Track progress
await checkpoint.markInProgress(0);
await checkpoint.markCompleted(0, { rows: 1000 });
// Get statistics
const progress = await checkpoint.getProgress();
console.log(progress.stats); // { total: 2, completed: 1, pending: 1, ... }
console.log(progress.percentComplete); // 50
pnpm test
Apache-2.0
FAQs
A hierarchical file-system buffer cache for HTTP responses
The npm package @_all_docs/cache receives a total of 10 weekly downloads. As such, @_all_docs/cache popularity was classified as not popular.
We found that @_all_docs/cache demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Socket has released a free Certified Patch for a critical Rails Active Storage vulnerability, giving developers time to upgrade to a secure Rails version.

Security News
/Threat Research
A malicious Ruby gem runs a credential-stealing worm during installation, poisons AI coding tools, and can wipe files when a stolen GitHub token is revoked.

Security News
GitHub is tightening GitHub Actions security with new restrictions on privileged pull request workflows. Here's what changes and how maintainers are affected.