Skip to content

navihtot/node-canvas-aws-lambda-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node canvas AWS Lambda example

Example of using AWS Lambda with node-canvas. node-canvas has a dependency on Cairo which is a native library with other native library dependencies which aren't currently available on the current AWS Lambda AMI (2015.09).

An AWS blog post describes the static compilation process (source):

You’ll need to either ensure that the libraries and their transitive dependencies are statically compiled or use rpath-style linking; we’ll do it the static way in this post, and demonstrate use of rpath in a subsequent post. (Note that many, but not all, libraries can be statically linked this way.)

However, to get this working for node-canvas I used dynamic linking with rpath. I more or less followed the process outlined by mankins on this this node-canvas GitHub issue

Files

src contains the compiled shared object files and index.js which contains the the lambda function (index.handler).

dist is just the contents of src compressed into a zip file which should be ready to upload to AWS Lambda.

About

Node canvas AWS Lambda example

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%