@ioki/node-ts-cache-storage-memory
v8.0.1
Published
Memory storage module for node-ts-cache
Downloads
1,128
Readme
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"]
}
}