imc

in-memory-cache

Really simple cache in memory for node.js

Showing:

Popularity

Downloads/wk

1

GitHub Stars

0

Maintenance

Last Commit

6yrs ago

Contributors

2

Package

Dependencies

1

Size (min+gzip)

37.4KB

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

memory-cache

Really simple cache in memory for node.js

  • No concurrence
  • No write
  • No deletes
  • Only Gets and Expiration

##How to use:

let cache = require('in-memory-cache')
let executions = 0
let time_consuming = () => { executions ++; return 'calculated value' }

await cache.read('some_key', time_consuming)
.then((value) => {
    console.log(`Here you have it: ${value}`)
})
await cache.read('some_key', time_consuming)
.then((value) => {
    console.log(`Here you have it again: ${value}`)
})

console.log(`Calculated ${executions} times`)

executions

If 'some_key' is present in cache the function y the second parameter doesn't execute. The function is where you put your time consuming process that you want to be cached.

CI status: Circle CI

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100