aws-lambda-bundler is a JavaScript utility designed to create zip archives for AWS Lambda function deployments. Its primary feature is the explicit exclusion of the `aws-sdk` from the bundled package, aiming to reduce the overall deployment size, as the SDK is often the largest component. The package is currently at version 1.0.12. Released over six years ago, it appears to be no longer actively maintained, with minimal updates or recent community activity. While it offers a simple command-line and programmatic interface for basic bundling, modern AWS Lambda deployment practices typically favor more advanced bundlers like `esbuild` (often integrated into AWS CDK's `NodejsFunction` or Serverless Framework) or `webpack` for their superior performance, tree-shaking capabilities, and better support for contemporary JavaScript features like TypeScript and ESM. These newer alternatives provide more granular control over dependencies and often result in smaller, more optimized bundles and improved cold start times.
npm install aws-lambda-bundlerVerified import paths — ran on the pinned version, not inferred.
Demonstrates programmatic bundling of a simple AWS Lambda project, including its dependencies, into a zip file, then cleans up.
Migrate to actively maintained alternatives like `@aws-cdk/aws-lambda-nodejs` (which uses `esbuild`), `serverless-esbuild`, `serverless-webpack`, or directly use `esbuild` for bundling. These tools provide better performance, security, and feature support.
Consider using a modern bundler that allows explicit inclusion and tree-shaking of AWS SDK v3 modules (e.g., `esbuild` with `bundleAwsSDK: true` in CDK's `NodejsFunction` configuration) to fine-tune cold start performance and ensure consistent SDK versions.
Evaluate modern bundlers (`esbuild`, `webpack`) that offer comprehensive support for TypeScript, ESM, and advanced optimizations like dead code elimination to significantly reduce package size and improve Lambda cold start times.
Run `npm install aws-lambda-bundler` or `yarn add aws-lambda-bundler` in your project directory.
Ensure your Lambda function code is written in CommonJS if using older tooling, or migrate to a modern bundler (like `esbuild`) that fully supports ESM input and output for Node.js Lambda functions.
Ensure you have appropriate write permissions for the target output directory, or specify an output path where the user has permissions (e.g., a subdirectory within your project or a temporary directory).
No dependency data recorded yet.