Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/umkus/lambda-layer-sharp
An AWS lambda layer with pre-built sharp node module optimised for minimal layer size
https://github.com/umkus/lambda-layer-sharp
aws aws-lambda aws-lambda-layer sharp
Last synced: 6 days ago
JSON representation
An AWS lambda layer with pre-built sharp node module optimised for minimal layer size
- Host: GitHub
- URL: https://github.com/umkus/lambda-layer-sharp
- Owner: Umkus
- Created: 2020-03-12T13:58:25.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-30T20:28:14.000Z (4 months ago)
- Last Synced: 2024-12-27T12:06:01.204Z (13 days ago)
- Topics: aws, aws-lambda, aws-lambda-layer, sharp
- Language: JavaScript
- Homepage:
- Size: 10 MB
- Stars: 94
- Watchers: 5
- Forks: 30
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AWS Sharp layer
This AWS lambda layer contains a latest pre-built vanilla [sharp](https://www.npmjs.com/package/sharp) npm library, so that you could "just use" it in your lambda code:```javascript
import sharp from 'sharp'
// ...
```It contains only necessary files to minimize its weight (16Mb).
It also supports all current AWS lambda node runtimes (>=`nodejs14.x`) and architectures (`x86_64` and `arm64`).# Getting
A pre-built layer zip file is available on the [Releases page](../../releases).You can import it into your AWS account throught the Lambda console or with the following command:
```shell
aws lambda publish-layer-version \
--layer-name sharp \
--description "Sharp layer" \
--license-info "Apache License 2.0" \
--zip-file fileb://dist/sharp-layer.zip \
--compatible-runtimes nodejs14.x nodejs16.x nodejs18.x nodejs20.x \
--compatible-architectures x86_64 arm64
```# Building
Simply run (this will wipe your existing `node_modules/` directory):
```shell
npm ci --arch=x64 --platform=linux
```Build will be performed automatically upon deps installation.
The resulted lambda layer zip file will be saved to `dist/` directory.