Methods
close
- close(): Promise<boolean>
delete
- delete(keys: string | string[]): Promise<number>
-
Parameters
Returns Promise<number>
expire
- expire(key: string, ttl: number): Promise<boolean>
-
Parameters
Returns Promise<boolean>
get
- get(key: string): Promise<any>
-
Parameters
Returns Promise<any>
has
- has(key: string): Promise<boolean>
-
Parameters
Returns Promise<boolean>
keys
- keys(): Promise<string[]>
-
Returns Promise<string[]>
set
- set(key: string, value: any, ttl?: number): Promise<boolean>
-
Parameters
-
key: string
-
value: any
-
Optional ttl: number
Returns Promise<boolean>
ttl
- ttl(key: string): Promise<number>
-
Parameters
Returns Promise<number>
Instantiate a new Cache with given driver. The
driver
is optional; if unspecified, defaults to Memory driver.