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

8.0.1 • Public • Published

node-ts-cache-storage-memory

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

yarn add @ioki/node-ts-cache
yarn add @ioki/node-ts-cache-storage-memory
import { Cache, CacheContainer } from "@ioki/node-ts-cache"
import { MemoryStorage } from "@ioki/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"]
    }
}

Package Sidebar

Install

npm i @ioki/node-ts-cache-storage-memory

Weekly Downloads

489

Version

8.0.1

License

MIT

Unpacked Size

4.46 kB

Total Files

10

Last publish

Collaborators

  • ans82
  • jonasstr
  • chb-ioki