node-ts-cache-storage-memory
TypeScript icon, indicating that this package has built-in type declarations

4.4.0 • Public • Published

In-Memory storage module for node-ts-cache.

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 4.4.0
    6,815
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 4.4.0
    6,815
  • 4.3.4
    1
  • 4.2.3
    209
  • 4.2.2
    0
  • 4.2.1
    0

Package Sidebar

Install

npm i node-ts-cache-storage-memory

Weekly Downloads

7,025

Version

4.4.0

License

MIT

Unpacked Size

7.5 kB

Total Files

8

Last publish

Collaborators

  • havsar