node-ts-cache-storage-memory

Memory storage module for node-ts-cache

Usage no npm install needed!

<script type="module">
  import nodeTsCacheStorageMemory from 'https://cdn.skypack.dev/node-ts-cache-storage-memory';
</script>

README

In-Memory storage module for node-ts-cache.

npm i node-ts-cache
npm i node-ts-cache-storage-memory
import { Cache, CacheContainer } from "node-ts-cache"
import { MemoryStorage } from "node-ts-cache-storage-memory"

const userCache = new CacheContainer(new MemoryStorage())

class MyService {
    @Cache(userCache, { ttl: 60 })
    public async getUsers(): Promise<string[]> {
        return ["Max", "User"]
    }
}