node-ts-cache-storage-memory
TypeScript icon, indicating that this package has built-in type declarations

4.4.0 • Public • Published

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"]
    }
}

/node-ts-cache-storage-memory/

    Package Sidebar

    Install

    npm i node-ts-cache-storage-memory

    Weekly Downloads

    7,025

    Version

    4.4.0

    License

    MIT

    Unpacked Size

    7.5 kB

    Total Files

    8

    Last publish

    Collaborators

    • havsar