faast.js

faast.js

  • Docs
  • API
  • Community
  • GitHub
  • Blog

faastjs package

Faast.js transforms ordinary JavaScript modules into serverless cloud functions that can run on AWS Lambda and Google Cloud Functions.

The main entry point to faast.js is the faast() function, which returns an object that implements the FaastModule interface. The most common options are CommonOptions. Using faast.js requires writing two modules, one containing the functions to upload to the cloud, and the other that invokes faast.js and calls the resulting cloud functions.

Classes

ClassDescription
CostMetricA line item in the cost estimate, including the resource usage metric measured and its pricing.
CostSnapshotA summary of the costs incurred by a faast.js module at a point in time. Output of FaastModule.costSnapshot().
FaastErrorFaastError is a subclass of VError (https://github.com/joyent/node-verror). that is thrown by faast.js APIs and cloud function invocations.
FaastModuleProxyImplementation of FaastModule.
FunctionStatsSummary statistics for function invocations.
FunctionStatsEventSummarize statistics about cloud function invocations.
PersistentCacheA simple persistent key-value store. Used to implement Limits.cache for throttle().
StatisticsIncrementally updated statistics on a set of values.

Enumerations

EnumerationDescription
FaastErrorNamesPossible FaastError names. See FaastError. To test for errors matching these names, use the static method FaastError.hasCauseWithName().

Functions

FunctionDescription
faast(provider, fmodule, options)The main entry point for faast with any provider and only common options.
faastAws(fmodule, options)The main entry point for faast with AWS provider.
faastGoogle(fmodule, options)The main entry point for faast with Google provider.
faastLocal(fmodule, options)The main entry point for faast with Local provider.
throttle(limits, fn)A decorator for rate limiting, concurrency limiting, retry, memoization, and on-disk caching. See Limits.

Interfaces

InterfaceDescription
AwsOptionsAWS-specific options for faastAws().
CleanupOptionsOptions that apply to the FaastModule.cleanup() method.
CommonOptionsOptions common across all faast.js providers. Used as argument to faast().
DetailA function return value with additional detailed information.
FaastModuleThe main interface for invoking, cleaning up, and managing faast.js cloud functions. Returned by faast().
GoogleOptionsGoogle-specific options for faastGoogle().
IncludeOptionOptions for the CommonOptions.include option.
LimitsSpecify throttle() limits. These limits shape the way throttle invokes the underlying function.
LocalOptionsLocal provider options for faastLocal().

Namespaces

NamespaceDescription
CostAnalyzerAnalyze the cost of a workload across many provider configurations.

Variables

VariableDescription
logFaast.js loggers.
providersAn array of all available provider.

Type Aliases

Type AliasDescription
AsyncAsync<T> maps regular values to Promises and Iterators to AsyncIterators, If T is already a Promise or an AsyncIterator, it remains the same. This type is used to infer the return value of cloud functions from the types of the functions in the user's input module.
AsyncDetailAsyncDetail<T> is similar to Async except it maps retun values R to Detail<R>, which is the return value with additional information about each cloud function invocation.
AwsFaastModuleThe return type of faastAws(). See FaastModuleProxy.
AwsRegionValid AWS regions. Not all of these regions have Lambda support.
GoogleFaastModuleThe return type of faastGoogle(). See FaastModuleProxy.
GoogleRegionValid Google Cloud regions. Only some of these regions have Cloud Functions.
LocalFaastModuleThe return type of faastLocal(). See FaastModuleProxy.
ProviderThe type of all supported cloud providers.
ProxyModuleProxyModule<M> is the type of FaastModule.functions.
ProxyModuleDetailSimilar to ProxyModule except each function returns a Detail object.
  • faastjs package
  • Classes
  • Enumerations
  • Functions
  • Interfaces
  • Namespaces
  • Variables
  • Type Aliases
faast.js
Docs
IntroductionAPI ReferenceContributingExamples
Community
DiscordTwitterStack Overflowfaast.js
More
BlogUser Showcase
Copyright © 2023 Andy Chou