Skip to content

heybeam/lambda-layer-canvas-nodejs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Canvas Layer for AWS Lambda

GitHub 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.

How to build this layer:

  1. Download Docker
  2. Pull the amazonlinux image
docker pull amazonlinux
  1. Run the docker instance
docker run -it amazonlinux:latest /bin/bash
  1. 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
  1. 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 .
  1. Upload your layer to AWS

About node-canvas

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 support

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.

Getting started

To get started, please visit https://github.com/charoitel/lambda-layer-canvas-nodejs/wiki/Getting-Started

Made with ❤️ by Charoite Lee and contributors.

About

AWS Lambda Layer with node-canvas and its dependencies packaged

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%