Welcome to the AWS SAM TypeScript Lambda Template. A clean, modern starting point for building AWS Lambda functions with Node.js and TypeScript, powered by the AWS Serverless Application Model (SAM). 🚀
This template helps you quickly spin up serverless projects with best practices baked in: strict type checking, linting, testing, and formatting included.
✅ AWS SAM-based Lambda setup
✅ TypeScript for type safety and modern development
✅ 🪵 Pino for fast, structured logging
✅ 🏗️ esbuild for super-fast builds
✅ ✅ Jest testing with TS + globals support
✅ ESLint + Prettier for clean, consistent code
✅ Handy scripts for linting, formatting, testing, and type-checking
sam build
sam local invoke MyTemplateGetAllFunction --event events/get-all-event.json
sam remote invoke MyTemplateGetAllFunction --stack-name aws-sam-ts-template
sam local start-api
sam validate --lint
sam deploy --guided
Script | Purpose |
---|---|
npm run type-check |
Run TypeScript strict type checking |
npm run lint |
Lint code with ESLint (auto-fix enabled) |
npm run test |
Run tests with Jest |
npm run format |
Format codebase with Prettier |
├── events/ # Sample event payloads for testing
├── src/ # Lambda function source code
├── tests/ # Unit tests
├── template.yaml # AWS SAM template definition
├── samconfig.toml # Deployment configuration
├── tsconfig.json # TypeScript configuration
├── eslint.config.js # ESLint config
├── jest.config.js # Jest config
├── .prettierrc # Prettier config
💡 "Don't reinvent the wheel — but make sure your wheel isn't square."
✅ Modern tooling
✅ Fast feedback loop
✅ Clean DX (Developer Experience)
MIT @ John James
"Horses don’t stop, they keep goin’." 🐎