Forked from charoitel/lambda-layer-canvas-nodejs
Since AWS Lambda is a secure and isolated runtime and execution environment, this layer aims to target AWS Lambda compatible build. As there are canvas libraries and frameworks relying on node-canvas running on Node.js runtime, this layer also tries to include and support these libraries and frameworks.
- Download Docker
- Pull the amazonlinux image
docker pull amazonlinux
- Run the docker instance
docker run -it amazonlinux:latest /bin/bash
- Inside the container:
bash-4.2# yum install git -y
bash-4.2# cd home/
bash-4.2# git clone https://github.com/heybeam/lambda-layer-canvas-nodejs.git
bash-4.2# cd lambda-layer-canvas-nodejs
bash-4.2# ./setup-env.sh
bash-4.2# source ~/.bashrc
bash-4.2# ./build-layer.sh
bash-4.2# exit
- Copy the layer zip from the docker container instance to your local machine:
# get the container ID
> docker ps
> docker cp <container-id>:/home/lambda-layer-canvas-nodejs/canvas-nodejs_v2.11.0.zip .
- Upload your layer to AWS
node-canvas is a Cairo backed Canvas implementation for Node.js. It implements the Mozilla Web Canvas API as closely as possible. For the current API compliance, please check Compatibility Status.
Fabric.js is a framework that makes it easy to work with HTML5 canvas element. It is an interactive object model on top of canvas element. It is also an SVG-to-canvas (and canvas-to-SVG) parser.
To get started, please visit https://github.com/charoitel/lambda-layer-canvas-nodejs/wiki/Getting-Started
Made with ❤️ by Charoite Lee and contributors.