@ioki/node-ts-cache-storage-node-fs
v8.0.1
Published
Nodejs filesystem storage module for node-ts-cache
Downloads
4
Readme
node-ts-cache-storage-node-fs
Node.js file system storage module for node-ts-cache.
yarn add @ioki/node-ts-cache @ioki/node-ts-cache-storage-node-fs
import { Cache, CacheContainer } from "@ioki/node-ts-cache"
import { NodeFsStorage } from "@ioki/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"]
}
}