Socket
Socket
Sign inDemoInstall

@jill64/types-lambda

Package Overview
Dependencies
Maintainers
0
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jill64/types-lambda

λ Unofficial AWS Lambda type definition


Version published
Weekly downloads
7.4K
increased by100.54%
Maintainers
0
Weekly downloads
 
Created
Source

@jill64/types-lambda

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

λ 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

MIT

Keywords

FAQs

Package last updated on 24 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc