Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

node-ts-cache-storage-node-fs

havsar2kMIT4.4.0TypeScript support: included

Nodejs filesystem storage module for node-ts-cache

node, nodejs, cache, typescript, ts, caching, memcache, memory-cache, redis-cache, redis, cache, file-cache, node-cache, ts-cache

readme

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"]
    }
}