Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

canvas-aws-prebuilt

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvas-aws-prebuilt

Adapted version of node-canvas to use with AWS and Serverless

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-62.5%
Maintainers
1
Weekly downloads
 
Created
Source

canvas-aws-prebuilt


##Adapted version of node-canvas to use with AWS and Serverless.

Important note: currently this module is using node-canvas v1.6.7. Support of v2 may be added later.

Installation

Download the package:

npm install --save canvas-aws-prebuilt

Next you'll need to copy the shared libraries from the package directory into the root of your Lambda package.

Serverless

You'll need these:

  • serverless-webpack
  • node-loader for canvas.node
  • copy-webpack-plugin with following configuration:
    module: {
        plugins: [
            new CopyWebpackPlugin([
                {
                    from: 'node_modules/canvas-aws-prebuilt/lib',
                    to: ''
                }
            ])
        ],
    }
    

AWS CLI / AWS Console

Copy all of the node_modules/canvas-aws-prebuilt/lib libs into the root folder of your Lambda package.

Usage

Replace require('canvas') with require('canvas-aws-prebuilt').

API

See node-canvas API.

FAQ

Can I use this in other environments (Windows, MacOS etc.)?

No, you're probably looking for node-canvas-prebuilt.

The Reason

I spent some time (a week, actually) trying to deploy a Serverless application with node-canvas (and succeeded), so I decided to make life easier for those who try to do the same. The main problem I came across is that the project used serverless-webpack with externals enabled, which prevented me from simply copying the pre-built module into node_modules.

Thanks

License

MIT

Keywords

FAQs

Package last updated on 26 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc