1.0.0 • Published 9 years ago

force-canvas v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

force-canvas

sanity check to get the canvas if input happens to be the context; errors if it can't return a canvas

Build Status npm version

Installation

Download node at nodejs.org and install it, if you haven't already.

npm install force-canvas --save

Usage

var forceCanvas = require('force-canvas');

let canvas = document.createElement('canvas')

canvas = forceCanvas(canvas)
canvas = forceCanvas(canvas.getContext('2d'))
canvas = forceCanvas('not a canvas or context') // Error

API

forceCanvas(canvas:canvas):canvas

License

MIT

1.0.0

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago

0.0.0

9 years ago