pompelmi v1.20.0 Release Notes
Release Date: 2026-05-15 // about 1 month ago-
โ Added
- ๐ท Star prompt printed to stderr on first import (skipped in CI and non-TTY environments), with a
~/.pompelmi/.starredmarker so it shows only once. - ๐จ
scripts/postinstall.jsโ prints a GitHub star nudge to stdout afternpm installin interactive terminals.
๐ Changed
- ๐ฆ
package.jsonโ addedpostinstallscript pointing toscripts/postinstall.js; bumped version to 1.20.0.
- ๐ท Star prompt printed to stderr on first import (skipped in CI and non-TTY environments), with a
Previous changes from v1.19.0
-
Title:
v1.19.0 โ Scan Cache, Policies, Multi-Engine, Directory StreamingBody:
## What's New### SHA256 Scan CacheSkip rescanning files that have already been verified. Cache results in memory or on disk with configurable TTL and LRU eviction.```jsconst{createCache}=require('pompelmi')constcache=createCache({ ttl:3600000, maxSize:1000})constresult=awaitcache.scan(filePath, options)// Second call with same file content: instant, no clamd roundtripcache.stats()// { hits: 42, misses: 8, size: 50, hitRate: 0.84 }File-based persistence across restarts:
constcache=createCache({storage:'file',filePath:'./.pompelmi-cache.json',ttl:86400000})Scan Policies
๐ Define all upload security rules in one place โ size, MIME type,
extension, and virus scanning โ and apply them with a single call.const{createPolicy}=require('pompelmi')constpolicy=createPolicy({scan:{host:'localhost',port:3310},maxSize:10\*1024\*1024,allowedMimeTypes:['image/jpeg','image/png','application/pdf'],allowedExtensions:['.jpg','.jpeg','.png','.pdf'],rejectEncrypted:true,onScannerUnavailable:'reject'})constresult=awaitpolicy.check(buffer,{filename:'upload.pdf',mimeType:'application/pdf',size:buffer.length})// { allowed: true, reason: null, verdict: Verdict.Clean }// Express middlewareapp.post('/upload',upload.single('file'),policy.middleware(),handler)Multi-Engine Scanning
Combine ClamAV with VirusTotal for higher confidence results.
const{createMultiEngine}=require('pompelmi')constscanner=createMultiEngine({engines:[{type:'clamav',host:'localhost',port:3310},{type:'virustotal',apiKey:process.env.VIRUSTOTAL\_API\_KEY}],consensus:'any'})constresult=awaitscanner.scanBuffer(buffer)// {// verdict: Verdict.Malicious,// engines: [// { name: 'clamav', verdict: Verdict.Malicious, virus: 'Win.Malware.Agent' },// { name: 'virustotal', verdict: Verdict.Clean, detections: 0 }//]// }Consensus modes:
any(strict) ยทall(lenient) ยทmajorityDirectory Streaming with Progress Events
Scan large directories with real-time progress via async iteration:
forawait(consteventofscanDirectory.stream('/uploads',options)){if(event.type==='progress'){console.log(`${event.scanned}/${event.total} โ ${event.file}`)}if(event.type==='result'){console.log(event.file,event.verdict)}if(event.type==='complete'){console.log('Done:',event.summary)}}๐ Changes
src/ScanCache.jsโ SHA256 cache with TTL, LRU, memory and file storage- ๐
src/Policy.jsโ unified upload security policy src/MultiEngine.jsโ multi-engine scanning with consensus modessrc/DirectoryScanner.jsโ streaming async iterator with progress eventssrc/index.jsโ exports createCache, createPolicy, createMultiEnginetypes/index.d.tsโ full type declarations for all new exports- ๐
docs/cache.htmlโ cache API reference - ๐
docs/policy.htmlโ policy API reference - ๐
docs/multi-engine.htmlโ multi-engine guide - โก๏ธ
docs/*.htmlโ navbar updated
Full Changelog