A deno runtime for AWS Lambda. Deploy deno via docker, SAM, serverless, or bundle it yourself.
Extremely Popular
Go to Latest
type alias Handler
import { type Handler } from "";

The interface that AWS Lambda will invoke your handler with. There are more specialized types for many cases where AWS services invoke your lambda, but you can directly use this type for when you are invoking your lambda directly.

See tme AWS documentation for more information about the runtime behavior, and the AWS Blog post introducing the async handler behavior in the 8.10 runtime.


interface NameEvent { fullName: string } interface NameResult { firstName: string middleNames: string lastName: string } type PersonHandler = Handler<NameEvent, NameResult>

export const handler: PersonHandler = async (event) => { const names = event.fullName.split(' ') const firstName = names.shift() const lastName = names.pop() return { firstName, middleNames: names, lastName } }

export const handler: Handler = async (event, context) => { console.log("EVENT: \n" + JSON.stringify(event, null, 2)) return context.logStreamName }

const s3 = new AWS.S3()

export const handler: Handler = async (event) => { const response = await s3.listBuckets().promise() return response? => bucket.Name) }

let url = ""

export const handler: Handler<void, number> = (event, context, callback) => { https.get(url, (res) => { callback(null, res.statusCode) }).on('error', (e) => { callback(Error(e)) }) }

Type Parameters

TEvent = any
TResult = any
definition: (event: TEvent, context: Context) => Promise<TResult>