7.0.2 • Published 3 years ago
@boredland/node-ts-cache-storage-node-fs v7.0.2
node-ts-cache-storage-node-fs
Node.js file system storage module for node-ts-cache.
yarn add @boredland/node-ts-cache @boredland/node-ts-cache-storage-node-fsimport { Cache, CacheContainer } from "@boredland/node-ts-cache"
import { NodeFsStorage } from "@boredland/node-ts-cache-storage-node-fs"
const userCache = new CacheContainer(new NodeFsStorage())
class MyService {
    @Cache(userCache, { ttl: 60 })
    public async getUsers(): Promise<string[]> {
        return ["Max", "User"]
    }
}