Gathering detailed insights and metrics for aedes-cached-persistence
Gathering detailed insights and metrics for aedes-cached-persistence
Gathering detailed insights and metrics for aedes-cached-persistence
Gathering detailed insights and metrics for aedes-cached-persistence
Abstract class to write an Aedes persistence with in-process caching of subscriptions
npm install aedes-cached-persistence
Typescript
Module System
Min. Node Version
Node Version
NPM Version
78.4
Supply Chain
100
Quality
85
Maintenance
100
Vulnerability
100
License
JavaScript (87.97%)
TypeScript (12.03%)
Total Downloads
799,591
Last Day
456
Last Week
4,283
Last Month
17,469
Last Year
322,274
MIT License
6 Stars
119 Commits
12 Forks
8 Watchers
1 Branches
8 Contributors
Updated on Jun 12, 2025
Minified
Minified + Gzipped
Latest Version
10.1.0
Package Id
aedes-cached-persistence@10.1.0
Unpacked Size
29.56 kB
Size
8.50 kB
File Count
16
NPM Version
10.8.2
Node Version
20.18.1
Published on
May 05, 2025
Cumulative downloads
Total Downloads
Last Day
38.6%
456
Compared to previous day
Last Week
-9.9%
4,283
Compared to previous week
Last Month
-2.7%
17,469
Compared to previous month
Last Year
149.7%
322,274
Compared to previous year
3
7
Abstract class to write an Aedes persistence with in-process caching of subscriptions. It implements the API defined by aedes-persistence.
To install aedes-cached-persistence, simply use npm:
1npm install aedes-cached-persistence --save
CachedPersistence()
instance.subscriptionsByTopic()
instance.cleanSubscriptions()
instance.destroy()
In order to reuse aedes-cached-persistence, you need to:
1const CachedPersistence = require('aedes-cached-persistence') 2 3// if you need http://npm.im/aedes-packet, it is available 4// from this module as well 5// const { Packet } = CachedPersistence 6 7class MyPersistence extends CachedPersistence { 8 constructor(opts) { 9 super(opts) 10 } 11 addSubscriptions(client, subs, cb) { 12 // ..persistence specific implementation.. 13 // call super._addedSubscriptions when you are done 14 super._addedSubscriptions(client, subs.map(mapSub), cb) 15 } 16 removeSubscriptions(client, subs, cb) { 17 // ..persistence specific implementation.. 18 // call super._removedSubscriptions when you are done 19 super._removedSubscriptions(client, subs.map(mapSub), cb) 20 } 21} 22 23function mapSub (sub) { 24 return { topic: sub.topic } 25}
A persistence needs to pass all tests defined in ./abstract.js. You can import and use that test suite in the following manner:
1const test = require('node:test') 2const myperst = require('./') 3const abs = require('aedes-cached-persistence/abstract') 4 5abs({ 6 test: test, 7 persistence: myperst 8})
If you require some async stuff before returning, a callback is also supported:
1const test = require('node:test') 2const myperst = require('./') 3const abs = require('aedes-persistence/abstract') 4const clean = require('./clean') // invented module 5 6abs({ 7 test: test, 8 buildEmitter: require('mymqemitter'), // optional 9 persistence: function build (cb) { 10 clean(function (err) { 11 cb(err, myperst()) 12 }) 13 } 14})
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
7 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 7
Reason
Found 15/25 approved changesets -- score normalized to 6
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More