Gathering detailed insights and metrics for @wemnyelezxnpm/nemo-accusamus-magnam
Gathering detailed insights and metrics for @wemnyelezxnpm/nemo-accusamus-magnam
Gathering detailed insights and metrics for @wemnyelezxnpm/nemo-accusamus-magnam
Gathering detailed insights and metrics for @wemnyelezxnpm/nemo-accusamus-magnam
npm install @wemnyelezxnpm/nemo-accusamus-magnam
Typescript
Module System
Node Version
NPM Version
53.1
Supply Chain
48.1
Quality
75.7
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
111
Last Day
1
Last Week
5
Last Month
18
Last Year
111
MIT License
20 Commits
1 Branches
Updated on Apr 27, 2024
Latest Version
1.0.0
Package Id
@wemnyelezxnpm/nemo-accusamus-magnam@1.0.0
Unpacked Size
10.43 kB
Size
4.62 kB
File Count
10
NPM Version
10.5.0
Node Version
20.12.2
Published on
Apr 25, 2024
Cumulative downloads
Total Downloads
Last Day
-50%
1
Compared to previous day
Last Week
-50%
5
Compared to previous week
Last Month
350%
18
Compared to previous month
Last Year
0%
111
Compared to previous year
33
A simple cache system for a single user request, built on the same concepts of data loader.
1npm i @wemnyelezxnpm/nemo-accusamus-magnam
1const { Factory } = require('.') 2const factory = new Factory() 3 4factory.add('fetchSomething', { 5 // cache by default, set to false to just do batching 6 cache: true 7}, async (queries, context) => { 8 console.log(queries) 9 // [ 42, 24 ] 10 11 console.log(context) 12 // { some: 'data' } 13 14 return queries.map((k) => { 15 return { k } 16 }) 17}) 18 19async function run () { 20 const context = { 21 some: 'data' 22 } 23 const cache = factory.create(context) 24 25 const p1 = cache.fetchSomething(42) 26 const p2 = cache.fetchSomething(24) 27 28 const res = await Promise.all([p1, p2]) 29 30 console.log(res) 31 // [ 32 // { k: 42 }, 33 // { k: 24 } 34 // ] 35} 36 37run().catch(console.log)
If the query parameter is an object, its cache key will be generated using safe-stable-stringify.
MIT
No vulnerabilities found.
No security vulnerabilities found.