Skip to content

Latest commit

 

History

History
41 lines (23 loc) · 2.8 KB

README.md

File metadata and controls

41 lines (23 loc) · 2.8 KB

Canvas Layer for AWS Lambda

GitHub

Canvas Layer for AWS Lambda is published and available on AWS Serverless Application Repository, and GitHub at charoitel/lambda-layer-canvas-nodejs. The layer aims to provide a Cairo backed Mozilla Web Canvas API implementation layer for AWS Lambda, powered by node-canvas.

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 latest API compliance, you may check Compatibility Status.

How this layer is built?

The layer is built from source of node-canvas npm package on amazonlinux dev container instance, with following native dependencies installed. You may check the build layer script, build-layer.sh, which is available in repository, for details.

gcc-c++ cairo-devel pango-devel libjpeg-turbo-devel giflib-devel librsvg2-devel pango-devel bzip2-devel jq python3

Since AWS Lambda is a secure and isolated runtime and execution environment, the layer aims to target AWS Lambda compatible and native build. As there are canvas libraries and frameworks relying on node-canvas running on Node.js runtime, this layer may also try to include and support those libraries and frameworks. Currently, following libraries and frameworks are included when building and packaging the layer:

Chart.js support

Chart.js provides a set of frequently used chart types, plugins, and customization options. In addition to a reasonable set of built-in chart types, there are also community-maintained chart types.

Current supported version chart.js@3.9.1 with chartjs-node-canvas@4.1.6

Fabric.js support

Fabric.js provides a missing and interactive object model for canvas, as well as an SVG parser, layer of interactivity, and a whole suite of other indispensable tools.

Current supported version fabric@6.4.2

Konva support

Konva enables high performance animations, transitions, node nesting, layering, filtering, caching, event handling for desktop and mobile applications, and much more.

Current supported version konva@9.3.15