This repository is designed for developing AWS Lambda functions with TypeScript. It allows seamless development in TypeScript and packages everything you need for deployment into the dist
folder, including a .zip
file.
- Write Lambda functions in TypeScript.
- Automatically compiles to
.mjs
for ES module support. - Packages all required files into
dist/lambda.zip
for deployment.
-
Install dependencies:
npm install
-
Start development:
npm run dev
-
Build for deployment:
npm run build
After building, the
dist
folder will contain:.mjs
files for your Lambda function.lambda.zip
ready for AWS Lambda.
-
Navigate to the
dist
folder:cd dist
-
Upload
lambda.zip
to your AWS Lambda function using the AWS console, CLI, or SDK.
npm run dev
: Starts development withts-node
.npm run build
: Compiles TypeScript to.mjs
, cleans unnecessary files, and createslambda.zip
.
src/ # Source TypeScript files
dist/ # Compiled and packaged output
lambda.zip # Deployment-ready package
Write your Lambda handler in src/index.ts
:
export const handler = async () => {
return {
statusCode: 200,
body: "Hello from a TypeScript Lambda!",
};
};
Orkhan Aliyev