copy-canvas
a more symantic way to duplicate an html5 canvas
Installation
Download node at nodejs.org and install it, if you haven't already.
npm install copy-canvas --save
Usage
// require modulevar copyCanvas = ; // create canvaslet canvas = document // draw a circlelet ctx = canvasctxctxctx // copy canvaslet copy = // verifylet copyData = copylet canvasData = canvascopyData === canvasData // truecopywidth === canvaswidth // truecopyheight === canvasheight // true
API
copyCanvas(canvas)
provided a canvas, returns a new canvas copy
License
MIT