4.4.0 • Published 3 years ago

node-ts-cache-storage-node-fs v4.4.0

Weekly downloads
12
License
MIT
Repository
github
Last release
3 years ago

Node.js file system storage module for node-ts-cache.

npm i node-ts-cache
npm i node-ts-cache-storage-node-fs
import { Cache, CacheContainer } from "node-ts-cache"
import { NodeFsStorage } from "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"]
    }
}