npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

build-lambda-layer

v0.3.8

Published

Build node awesome lambda layers with controls 🕹

Downloads

251

Readme

Build Lambda Layer

Typed with TypeScript ci npm Github

Builds Awesome Node Lambda Layers with Control! 🕹

Build Lambda Layer is a utility CLI for building AWS Lambda Layers with control for AWS Node Lambda projects.


Why is this written?

Build Lambda Layer takes complexity out of building lambda layers!


+ Monorepo support + The ability to ignore and add dependencies at run time + Easy json configuration!


How does it does it work?

By running:

build-layer <your-lambda-layer>

Build Lambda Layer will:

  • install all package.json dependencies to <your-lambda-layer>, and
  • zip it up to be uploaded to AWS 🚀

Additionally, Build Lambda Layer works with monorepos!

A key additional feature that Build Lambda Layer provides is that it works with monorepos!

By running:

build-layer my-lambda-layer --files 'packages/**/package.json'

Build Lambda Layer will:

  • install all package/**/package.json dependencies to your lambda layer, and
  • zip it up to be uploaded to AWS

Ignore and include the dependencies you want!

Build Lambda Layer supports specificity with ignore and include options.

By adding a "lambdaLayer" object to a package.json file you're building from, you can specify packages to ignore and include:

{
  "buildLambda": {
    "ignore": ["@types/aws-lambda"],
    "include": {
      "aws-lambda": "latest"
    }
  }
}

You can also add a lambdaLayerrc file to your project root if you want to preserve your package.json file.

{
  "ignore": ["@types/aws-lambda"],
  "include": {
    "aws-lambda": "latest"
  }
}

Be really selective with your installs

There is nothing stopping you from creating your own dependency object to install.

Add a <your-dependencies>.json file to your project root:

{
  "dependencies": {
    "aws-lambda": "latest"
  }
}

And run:

build-layer my-lambda-layer --files '<your-dependencies>.json'

That's it! 🎉

Save yourself the time and effort of building Lambda Layers and let Build Lambda Layer do it for you!


Install

pnpm install build-lambda-layer

CLI API

Usage: build-layer [options] <dir>

Build Lambda Layer, Build node awesome lambda layers with controls 🕹

Arguments:
  dir                                 lambda layer directory to build to

Options:
  --architectures [architectures...]  architectures for deployment to AWS
  --bucket <bucket>                   bucket to deploy to using AWS
  -c, --config <config>               path to a config file
  --deploy                            deploy your lambda layer
  -n, --name <name>                   lambda layer name
  --debug                             enable debugging
  -f, --files [files...]              file glob pattern
  -i, --ignore [ignore...]            ignore glob pattern
  --isTesting                         enable running fn tests w/o overwriting
  --noZip                             don't zip lambda layer
  -o, --output <output>               output path
  -r, --rootDir <rootDir>             root directory to start search
  --runner <runner>                   npm, pnpm, or yarn
  --runtimes [runtimes...]            runtimes for deployment to AWS
  -t, --isTestingCLI                  enable CLI only testing
  -h, --help                          display help for command

Recipes

Debugging

Gets you logging in your terminal

build-layer <dir> --debug
No Zip

Just build you a directory

build-layer <dir> --noZip
Custom runner

Build everything with a runner besides npm. Options are npm, pnpm, or yarn

build-layer <dir> --runner 'pnpm'
AWS Deploy

Assumes you're authenticated, have the AWS CLI, and have already deployed the layer to S3. AKA, implemented but not actively guaranteed to work!

build-layer <dir> --bucket <bucket> --runtimes [runtimes...] --architectures [architectures...]

Made by @yowainwright for fun with passion! MIT, 2022