UNPKG

lambda-layer-packager

Version:

A professional CLI tool designed to package Node.js modules into a zip file for AWS Lambda Layers, facilitating efficient deployment and management of serverless applications.

73 lines (48 loc) • 2.06 kB
<p align="center"> <img src="https://88tynjcpeunoim0x.public.blob.vercel-storage.com/image/lambda-layer-packager-logo.png" alt="Lambda Layer Packager" width="200"> </p> # Lambda Layer Packager [![Version](https://img.shields.io/npm/v/lambda-layer-packager.svg)](https://npmjs.org/package/lambda-layer-packager) [![License](https://img.shields.io/npm/l/lambda-layer-packager.svg)](https://github.com/Vijay431/lambda-layer-packager/blob/master/package.json) [![Downloads/week](https://img.shields.io/npm/dw/lambda-layer-packager.svg)](https://npmjs.org/package/lambda-layer-packager) A command-line utility for packaging Node.js dependencies into AWS Lambda Layers. Automatically compresses `node_modules` into deployment-ready `.zip` files compatible with AWS Lambda, Serverless Framework, and Terraform. ## Features - Supports multiple package managers (npm, yarn, pnpm) - Compatible with ES Modules (ES2022) and CommonJS - Configurable output directory structure - Production dependencies filtering - Simple command-line interface ## Installation ```bash # Global installation npm install -g lambda-layer-packager@latest # Project-specific installation npm install --save-dev lambda-layer-packager@latest ``` Verify installation: `packager --version` ## Command Reference ### List Available Commands ```bash packager commands ``` ### Package Dependencies ```bash packager package [options] ``` Options: - `--name`: Output filename (default: "layer.zip") - `--package-manager`: Package manager selection (default: "npm") - `--dir`: Target directory in archive (default: "nodejs/default") - `--only-prod`: Include only production dependencies (default: true) - `--help`: Show command help ## Dependencies This project leverages the following open-source packages: - `figlet` - ASCII art generation - `commander` - CLI framework - `archiver` - Archive creation - `spinnies` - Terminal spinners All dependencies are MIT licensed. ## License MIT License - See package.json for details. --- šŸ“¦ Built with open source. Contributions welcome!