My opinionated CLI tool for generating AWS Lambda projects with Node.js, providing a modern development experience with TypeScript, testing frameworks, and best practices I've refined over years of serverless development.
You are me. Or, you like the way I structure my Lambda projects and want to save time by using my template. Either way, thanks for checking this out.
- π Scaffolds Lambda projects
- π TypeScript or JavaScript
- π¦ Bundle with esbuild or webpack
- π§ͺ Testing setup
- π οΈ AWS Lambda PowerTools included
- π’ Deployment configs for various frameworks
- π Linting rules
- ποΈ A usable project structure
# Using pnpm
pnpm add -g create-mlpz-lambda
# Using npm
npm install -g create-mlpz-lambda
# Using yarn
yarn global add create-mlpz-lambda
# Interactive mode
npx create-mlpz-lambda my-lambda-service
# Use my personal defaults (TypeScript, esbuild, Jest, PowerTools, AWS CDK)
npx create-mlpz-lambda my-lambda-service --yes
When running in interactive mode, you'll be prompted for:
- Project name: Name for your Lambda service (also used as directory name)
- Language: TypeScript or JavaScript
- Bundler: esbuild, webpack, or none
- Testing framework: Jest or none
- AWS Lambda PowerTools: Include helpful utilities for Lambda functions
- Deployment framework: AWS CDK, AWS SAM, Serverless Framework, or none
The generated project follows my preferred organization pattern:
my-lambda-service/
βββ src/
β βββ handlers/ # Lambda function handlers
β βββ services/ # Business logic
β βββ utils/ # Utility functions
β βββ models/ # Type definitions and models
βββ tests/
β βββ unit/ # Unit tests
β βββ integration/ # Integration tests
βββ .eslintrc.js # ESLint configuration
βββ .prettierrc # Prettier configuration
βββ .gitignore # Git ignore file
βββ package.json # Project dependencies and scripts
βββ tsconfig.json # TypeScript configuration (if applicable)
βββ [deployment config] # Based on selected framework
After generating your project:
# Change into project directory
cd my-lambda-service
# Install dependencies
pnpm install # or npm install or yarn
# Development with hot reload
pnpm dev # or npm run dev or yarn dev
# Run tests
pnpm test # or npm test or yarn test
# Build for production
pnpm build # or npm run build or yarn build
# Deploy (if using a deployment framework)
pnpm deploy # or npm run deploy or yarn deploy
I was tired of repeating the same setup steps for every new Lambda project and wanted to codify my preferred patterns into something reusable. This tool embodies what I believe to be the ideal starting point for modern serverless Node.js applications on AWS.
This project uses Conventional Commits for automated versioning and release notes generation. A pre-commit hook is set up to enforce this format.
See COMMIT_CONVENTION.md for a quick reference guide to the commit format.
For more details on the release process, see RELEASING.md.
MIT License
Copyright (c) 2025 Mario Lopez
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.