faast.js

faast.js

  • Docs
  • API
  • Community
  • GitHub
  • Blog

faastjs > PersistentCache > (constructor)

PersistentCache.(constructor)

Construct a new persistent cache, typically used with Limits as part of the arguments to throttle().

Signature:

constructor(
    dirRelativeToHomeDir: string, 
    expiration?: number);

Parameters

Parameter

Type

Description

dirRelativeToHomeDir

string

The directory under the user's home directory that will be used to store cached values. The directory will be created if it doesn't exist.

expiration

number

(Optional) The age (in ms) after which a cached entry is invalid. Default: 24*3600*1000 (1 day).

  • PersistentCache.(constructor)
  • Parameters
faast.js
Docs
IntroductionAPI ReferenceContributingExamples
Community
DiscordTwitterStack Overflow
More
BlogUser Showcase
Copyright © 2025 Andy Chou