@jill64/types-lambda

1.2.3 • Public • Published

@jill64/types-lambda

npm-version npm-license npm-download-month npm-min-size

λ Unofficial AWS Lambda type definition

Examples

import type { LambdaHandler } from '@jill64/types-lambda'

export const handler: LambdaHandler = async (event) => {
  // ...

  return {
    statusCode: 200,
    body: 'Hello from Lambda !'
  }
}
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()
  }
)
import type { OriginRequestHandler } from '@jill64/types-lambda'

export const handler: OriginRequestHandler = async (event, context) => {
  // ...

  return {
    status: '200'
  }
}

License

MIT

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.2.34,718latest

Version History

VersionDownloads (Last 7 Days)Published
1.2.34,718
1.2.2596
1.2.144
1.2.00
1.1.45
1.1.30
1.1.20
1.1.10
1.1.00
1.0.140
1.0.130
1.0.120
1.0.110
1.0.100
1.0.90
1.0.80
1.0.70
1.0.60
1.0.50
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00
0.1.189
0.1.170
0.1.160
0.1.150
0.1.140
0.1.130
0.1.120
0.1.110
0.1.90
0.1.80
0.1.70
0.1.60
0.1.50
0.1.40
0.1.30
0.1.20

Package Sidebar

Install

npm i @jill64/types-lambda

Weekly Downloads

5,372

Version

1.2.3

License

MIT

Unpacked Size

40.3 kB

Total Files

40

Last publish

Collaborators

  • jill64