1.2.1 • Published 10 days ago
@jill64/types-lambda v1.2.1
@jill64/types-lambda
λ Unofficial AWS Lambda type definition
Examples
Lambda (Function URL)
import type { LambdaHandler } from '@jill64/types-lambda'
export const handler: LambdaHandler = async (event) => {
// ...
return {
statusCode: 200,
body: 'Hello from Lambda !'
}
}
Lambda (Streaming Response)
import { awslambda } from '@jill64/types-lambda'
export const handler = awslambda.streamifyResponse(
async (event, responseStream, _context) => {
// ...
const metadata = {
statusCode: 200,
headers: {
'Content-Type': 'application/json'
}
}
responseStream = awslambda.HttpResponseStream.from(responseStream, metadata)
responseStream.write('Streaming with Helper \n')
responseStream.write('Hello 0 \n')
responseStream.write('Hello 1 \n')
responseStream.write('Hello 2 \n')
responseStream.end()
await responseStream.finished()
}
)
Lambda@Edge
import type { OriginRequestHandler } from '@jill64/types-lambda'
export const handler: OriginRequestHandler = async (event, context) => {
// ...
return {
status: '200'
}
}
License
1.2.0
10 days ago
1.2.1
10 days ago
1.1.4
1 month ago
1.1.3
2 months ago
1.1.2
3 months ago
1.1.1
5 months ago
1.1.0
5 months ago
1.0.14
5 months ago
1.0.13
5 months ago
1.0.12
5 months ago
1.0.11
5 months ago
1.0.10
6 months ago
1.0.9
6 months ago
1.0.8
6 months ago
1.0.7
6 months ago
1.0.6
6 months ago
1.0.5
6 months ago
1.0.4
6 months ago
1.0.3
6 months ago
1.0.2
7 months ago
1.0.1
7 months ago
1.0.0
7 months ago
0.1.18
7 months ago
0.1.17
7 months ago
0.1.16
7 months ago
0.1.15
7 months ago
0.1.14
7 months ago
0.1.13
7 months ago
0.1.12
7 months ago
0.1.11
7 months ago
0.1.9
7 months ago
0.1.8
7 months ago
0.1.7
7 months ago
0.1.6
7 months ago
0.1.5
7 months ago
0.1.4
7 months ago
0.1.3
7 months ago
0.1.2
7 months ago