{"_id":"@brendangooch/canvas","_rev":"7-385278981c015977e55767043bb44fff","name":"@brendangooch/canvas","dist-tags":{"latest":"5.1.0"},"versions":{"1.0.0":{"name":"@brendangooch/canvas","version":"1.0.0","keywords":["canvas","html canvas","canvas api"],"author":{"name":"B Gooch","email":"brendangooch@gmail.com"},"license":"MIT","_id":"@brendangooch/canvas@1.0.0","maintainers":[{"name":"brendangooch","email":"brendangooch@gmail.com"}],"homepage":"https://github.com/brendangooch/canvas#readme","bugs":{"url":"https://github.com/brendangooch/canvas/issues","email":"brendangooch@gmail.com"},"dist":{"shasum":"c3e52d2e1b58d2b998a3a7d13cfb289d6455bff8","tarball":"https://registry.npmjs.org/@brendangooch/canvas/-/canvas-1.0.0.tgz","fileCount":29,"integrity":"sha512-pOcT5jfg0NjW//YCuczd8KqPp1tSnzOFZZYhV0U9nUdU5EjBkhNJf7X9PVIkiJHbGmHj0xA+KBfwX2e9lgm+Vw==","signatures":[{"sig":"MEQCIBVNhP9SbqWaVlwa24Jetq050WKkUYvGH5pWSp7+MsPVAiBGM04tDl2mTtBjT4/38yQWnoOopDrKezUvipeC6cJTrA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":40414},"type":"module","types":"./lib/canvas.d.ts","exports":{".":"./lib/canvas.js"},"gitHead":"5b45407db7ed9587eb84e06e473edea20fc1c6b5","private":false,"scripts":{"test":"clear && npm run build && NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --verbose","build":"npm run clear & tsc","clear":"rm -rf lib"},"_npmUser":{"name":"brendangooch","email":"brendangooch@gmail.com"},"repository":{"url":"git+https://github.com/brendangooch/canvas.git","type":"git"},"_npmVersion":"10.8.0","description":"a cleaner implementation of the HTML Canvas API","directories":{},"_nodeVersion":"21.4.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","canvas":"^2.11.2","typescript":"^5.4.5","@types/jest":"^29.5.12","jest-environment-jsdom":"^29.7.0"},"_npmOperationalInternal":{"tmp":"tmp/canvas_1.0.0_1716658492822_0.7336141862211267","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"@brendangooch/canvas","version":"2.0.0","keywords":["canvas","html canvas","canvas api"],"author":{"name":"B Gooch","email":"brendangooch@gmail.com"},"license":"MIT","_id":"@brendangooch/canvas@2.0.0","maintainers":[{"name":"brendangooch","email":"brendangooch@gmail.com"}],"homepage":"https://github.com/brendangooch/canvas#readme","bugs":{"url":"https://github.com/brendangooch/canvas/issues","email":"brendangooch@gmail.com"},"dist":{"shasum":"38797eaafebccd562325464a1b25d732f0392e23","tarball":"https://registry.npmjs.org/@brendangooch/canvas/-/canvas-2.0.0.tgz","fileCount":23,"integrity":"sha512-xoi+uMorGDGGkLcYzupTp4lPnUkLyuDlyma5Udtj5S7p1garGYfgYyAlaC1a7nTVcFismCLaZyguMnZ+Q4w0BA==","signatures":[{"sig":"MEUCIA3wA//c2C7uqhnZfDxi8XaNcg6MPDMI+3LP3dcSrKlBAiEA82n2M7gToC/piARaxfEBY8FVXMNL33uJBnKWnrFXl5g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16876},"type":"module","types":"./lib/index.d.ts","exports":{".":"./lib/index.js"},"gitHead":"5c84bb997fbde3eb60ec382fd50616f0fd50d151","private":false,"scripts":{"build":"tsc -p tsconfig.prod.json","prepack":"npm run build","prebuild":"npm run remove-lib","build-dev":"npm run prebuild && tsc","remove-lib":"rm -rf lib"},"_npmUser":{"name":"brendangooch","email":"brendangooch@gmail.com"},"repository":{"url":"git+https://github.com/brendangooch/canvas.git","type":"git"},"_npmVersion":"10.8.3","description":"a cleaner implementation of the HTML Canvas API","directories":{},"_nodeVersion":"21.4.0","dependencies":{"@brendangooch/maths":"^3.0.0","@brendangooch/image-sprite":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.3"},"_npmOperationalInternal":{"tmp":"tmp/canvas_2.0.0_1729759746774_0.06232781004537857","host":"s3://npm-registry-packages"}},"2.1.0":{"name":"@brendangooch/canvas","version":"2.1.0","keywords":["canvas","html canvas","canvas api"],"author":{"name":"B Gooch","email":"brendangooch@gmail.com"},"license":"MIT","_id":"@brendangooch/canvas@2.1.0","maintainers":[{"name":"brendangooch","email":"brendangooch@gmail.com"}],"homepage":"https://github.com/brendangooch/canvas#readme","bugs":{"url":"https://github.com/brendangooch/canvas/issues","email":"brendangooch@gmail.com"},"dist":{"shasum":"30c67daaa9d19a1eccf680cc5738158fda18c977","tarball":"https://registry.npmjs.org/@brendangooch/canvas/-/canvas-2.1.0.tgz","fileCount":25,"integrity":"sha512-RgZmWbxqmdrxRfxdgWMa5QG3uyflHfFbau7yXUV22FvsS/muSTuWr0+69K1xeBiahyFEwI7F8HJqJIF84Ii0dw==","signatures":[{"sig":"MEUCIQDaUETFem7caY6JLG06/DkCxl8aZCEO8gwp7w3byrjtywIgeGograpI40WhTxQg7PVWCtYSxvgvOOEGcnsI6xmnDXQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18421},"type":"module","types":"./lib/index.d.ts","exports":{".":"./lib/index.js"},"gitHead":"34d51c9d353e106d14c26f5f2d9caa146d61257a","private":false,"scripts":{"build":"tsc -p tsconfig.prod.json","prepack":"npm run build","prebuild":"npm run remove-lib","build-dev":"npm run prebuild && tsc","remove-lib":"rm -rf lib"},"_npmUser":{"name":"brendangooch","email":"brendangooch@gmail.com"},"repository":{"url":"git+https://github.com/brendangooch/canvas.git","type":"git"},"_npmVersion":"10.8.3","description":"a cleaner implementation of the HTML Canvas API","directories":{},"_nodeVersion":"21.4.0","dependencies":{"@brendangooch/maths":"^3.0.0","@brendangooch/image-sprite":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.3"},"_npmOperationalInternal":{"tmp":"tmp/canvas_2.1.0_1729767346520_0.36814849136257144","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"@brendangooch/canvas","version":"3.0.0","keywords":["canvas","html canvas","canvas api"],"author":{"name":"B Gooch","email":"brendangooch@gmail.com"},"license":"MIT","_id":"@brendangooch/canvas@3.0.0","maintainers":[{"name":"brendangooch","email":"brendangooch@gmail.com"}],"homepage":"https://github.com/brendangooch/canvas#readme","bugs":{"url":"https://github.com/brendangooch/canvas/issues","email":"brendangooch@gmail.com"},"dist":{"shasum":"7e8f201ac6e33e5c50501fac0b16077975fb9524","tarball":"https://registry.npmjs.org/@brendangooch/canvas/-/canvas-3.0.0.tgz","fileCount":25,"integrity":"sha512-DQ4Xhe3iFbWcfOmJPfVyEs+KLgys8Fu0z8lTz7/wh7CYsY1RILTzV7NwWLo762qhzTimLSGkunsIaIg/L+KZEw==","signatures":[{"sig":"MEQCIFa9H6He7rZBNJCy3kAhNHo9DBOz8SdzkCyT4tCTNl6ZAiAHfKpo+C2pWgpiRodMGaQJ40QIOSXcV5skeAUp3RvlDQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21745},"type":"module","types":"./lib/index.d.ts","exports":{".":"./lib/index.js"},"gitHead":"34d51c9d353e106d14c26f5f2d9caa146d61257a","private":false,"scripts":{"build":"tsc -p tsconfig.prod.json","prepack":"npm run build","prebuild":"npm run remove-lib","build-dev":"npm run prebuild && tsc","remove-lib":"rm -rf lib"},"_npmUser":{"name":"brendangooch","email":"brendangooch@gmail.com"},"repository":{"url":"git+https://github.com/brendangooch/canvas.git","type":"git"},"_npmVersion":"10.9.1","description":"a cleaner implementation of the HTML Canvas API","directories":{},"_nodeVersion":"21.4.0","dependencies":{"@brendangooch/maths":"^3.0.0","@brendangooch/image-sprite":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.3"},"_npmOperationalInternal":{"tmp":"tmp/canvas_3.0.0_1732877520490_0.9229380286473488","host":"s3://npm-registry-packages"}},"4.0.0":{"name":"@brendangooch/canvas","version":"4.0.0","keywords":["canvas","html canvas","canvas api"],"author":{"name":"B Gooch","email":"brendangooch@gmail.com"},"license":"MIT","_id":"@brendangooch/canvas@4.0.0","maintainers":[{"name":"brendangooch","email":"brendangooch@gmail.com"}],"homepage":"https://github.com/brendangooch/canvas#readme","bugs":{"url":"https://github.com/brendangooch/canvas/issues","email":"brendangooch@gmail.com"},"dist":{"shasum":"98b3d02d6fa97ffeb7905e0e94e59b4be49fb3e4","tarball":"https://registry.npmjs.org/@brendangooch/canvas/-/canvas-4.0.0.tgz","fileCount":25,"integrity":"sha512-pXUYY3AcEl5XMtc+NyjnATXallfVb0T4vYaCZskNj+TX8RH730CN5BBNui3qyLnOIom+43Gd+Ep3sisgtK0o3w==","signatures":[{"sig":"MEQCIBEl097UO6N8r/TJlRg4uNRnJWopq7IaZLM7s7e3NIhFAiA80+56Z6vpggCmhgTiUjnDjjz7/7ej9iIZG0/i2+P+IA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21719},"type":"module","types":"./lib/index.d.ts","exports":{".":"./lib/index.js"},"gitHead":"cecb932e98cb2e45a15e2f87cdf86b91213027c3","private":false,"scripts":{"build":"tsc -p tsconfig.prod.json","prepack":"npm run build","prebuild":"npm run remove-lib","build-dev":"npm run prebuild && tsc","remove-lib":"rm -rf lib"},"_npmUser":{"name":"brendangooch","email":"brendangooch@gmail.com"},"repository":{"url":"git+https://github.com/brendangooch/canvas.git","type":"git"},"_npmVersion":"10.9.1","description":"a cleaner implementation of the HTML Canvas API","directories":{},"_nodeVersion":"21.4.0","dependencies":{"@brendangooch/maths":"^3.0.0","@brendangooch/image-sprite":"^4.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.3"},"_npmOperationalInternal":{"tmp":"tmp/canvas_4.0.0_1733414113015_0.3185109876709231","host":"s3://npm-registry-packages"}},"5.0.0":{"name":"@brendangooch/canvas","version":"5.0.0","keywords":["canvas","html canvas","canvas api"],"author":{"name":"B Gooch","email":"brendangooch@gmail.com"},"license":"MIT","_id":"@brendangooch/canvas@5.0.0","maintainers":[{"name":"brendangooch","email":"brendangooch@gmail.com"}],"homepage":"https://github.com/brendangooch/canvas#readme","bugs":{"url":"https://github.com/brendangooch/canvas/issues","email":"brendangooch@gmail.com"},"dist":{"shasum":"302234b072a821878b55fd0298ac65953533bc0b","tarball":"https://registry.npmjs.org/@brendangooch/canvas/-/canvas-5.0.0.tgz","fileCount":25,"integrity":"sha512-fSTQBX17i5EyDL2tHe/Thn9u0OWZL6xhTwKEfczxFVHtbYvOP++R7h1f4utkHyxfkT3vAFgVYlfW7k7QlgF1GA==","signatures":[{"sig":"MEYCIQCW916Us00TZmsG8Nny04nTYUrld7WFdXQsKlVj3xVeGwIhAMeB17Wlvf499zeXYNtopr4OZRSfn4nKzUNOce2EJXdp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21753},"type":"module","types":"./lib/index.d.ts","exports":{".":"./lib/index.js"},"gitHead":"35001dd7d5eaadf5340217a3cee422960c211c36","private":false,"scripts":{"build":"tsc -p tsconfig.prod.json","prepack":"npm run build","prebuild":"npm run remove-lib","build-dev":"npm run prebuild && tsc","remove-lib":"rm -rf lib"},"_npmUser":{"name":"brendangooch","email":"brendangooch@gmail.com"},"repository":{"url":"git+https://github.com/brendangooch/canvas.git","type":"git"},"_npmVersion":"10.9.2","description":"a cleaner implementation of the HTML Canvas API","directories":{},"_nodeVersion":"21.4.0","dependencies":{"@brendangooch/maths":"^3.0.0","@brendangooch/image-sprite":"^5.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.3"},"_npmOperationalInternal":{"tmp":"tmp/canvas_5.0.0_1733856619105_0.21657037886233677","host":"s3://npm-registry-packages-npm-production"}},"5.1.0":{"name":"@brendangooch/canvas","version":"5.1.0","description":"a cleaner implementation of the HTML Canvas API","author":{"name":"B Gooch","email":"brendangooch@gmail.com"},"license":"MIT","scripts":{"build":"tsc -p tsconfig.prod.json","build-dev":"npm run prebuild && tsc","prebuild":"npm run remove-lib","prepack":"npm run build","remove-lib":"rm -rf lib"},"private":false,"publishConfig":{"access":"public"},"type":"module","exports":{".":"./lib/index.js"},"types":"./lib/index.d.ts","devDependencies":{"typescript":"^5.6.3"},"repository":{"type":"git","url":"git+https://github.com/brendangooch/canvas.git"},"homepage":"https://github.com/brendangooch/canvas#readme","bugs":{"url":"https://github.com/brendangooch/canvas/issues","email":"brendangooch@gmail.com"},"keywords":["canvas","html canvas","canvas api"],"dependencies":{"@brendangooch/image-sprite":"^5.0.0","@brendangooch/maths":"^3.0.0"},"_id":"@brendangooch/canvas@5.1.0","gitHead":"0e30b782508f75793eb8a76b45ee63e1f43da1cb","_nodeVersion":"21.4.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-W8u9XzXEt/RMhcplAELaIQ0NNO7AD5ZSMqBk9HSuXLwtjftvcnJrCP3NQqBNOFPfEOHcC72yIz3ic1snk8WOLg==","shasum":"821643e71cae93a5386df986f03d4d21cf56a314","tarball":"https://registry.npmjs.org/@brendangooch/canvas/-/canvas-5.1.0.tgz","fileCount":25,"unpackedSize":22253,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDeoZJF1GCgGrjw8ilsbi68pwqlxmiMsYgKK/I7dqJs4wIgW5qeZB7Om4P6fnFhzN+OkTCh3yQy6XhBoJkpiTGE4LI="}]},"_npmUser":{"name":"brendangooch","email":"brendangooch@gmail.com"},"directories":{},"maintainers":[{"name":"brendangooch","email":"brendangooch@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/canvas_5.1.0_1745589730224_0.44162377796825436"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-25T17:34:52.736Z","modified":"2025-04-25T14:02:10.573Z","1.0.0":"2024-05-25T17:34:53.062Z","2.0.0":"2024-10-24T08:49:06.954Z","2.1.0":"2024-10-24T10:55:46.677Z","3.0.0":"2024-11-29T10:52:00.638Z","4.0.0":"2024-12-05T15:55:13.211Z","5.0.0":"2024-12-10T18:50:19.372Z","5.1.0":"2025-04-25T14:02:10.406Z"},"bugs":{"url":"https://github.com/brendangooch/canvas/issues","email":"brendangooch@gmail.com"},"author":{"name":"B Gooch","email":"brendangooch@gmail.com"},"license":"MIT","homepage":"https://github.com/brendangooch/canvas#readme","keywords":["canvas","html canvas","canvas api"],"repository":{"type":"git","url":"git+https://github.com/brendangooch/canvas.git"},"description":"a cleaner implementation of the HTML Canvas API","maintainers":[{"name":"brendangooch","email":"brendangooch@gmail.com"}],"readme":"# canvas\na cleaner implementation of the Canvas API\n\nexample usage:\n\n```html\n<canvas id=\"canvas\"></canvas>\n```\n\n```typescript\nimport { Canvas } from '@nremdamgooch/canvas';\n\nconst ctx = document.getElementById('canvas').getContext('2d');\nctx.save();\nctx.translate(500, 500);\nctx.rotate(Math.PI);\nctx.scale(0.8, 0.8);\nctx.globalAlpha = 0.75;\nctx.fillStyle = 'red';\nctx.lineWidth = 10;\nctx.setLineDash([20, 40]);\nctx.lineDashOffset = 10;\nctx.lineCap = 'round';\nctx.linJoin = 'bevel';\nctx.beginPath();\nctx.shadowOffsetX = 5;\nctx.shadowOffsetY = 5;\nctx.shadowBlur = 10;\nctx.shadowColor = 'black';\nctx.roundRect(200, 300, 10);\nctx.stroke();\nctx.font = 'italic 24px arial';\nctx.textAlign = 'center';\nctx.textBaseline = 'middle';\nctx.fillText('this is some text');\nctx.fontVariantCaps = 'all-small-caps';\nctx.restore();\nctx.clearRect(0,0,1920, 1080)\n\n\n// using Canvas class\n\n// static properties\nCanvas.CONTAINED = true;\nCanvas.ALPHA_ENABLED = true;\nCanvas.SMOOTHING_ENABLED = false;\nCanvas.SMOOTHING_QUALITY = 'medium';\nCanvas.ACCESSIBLE_CONTENT_ENABLED = true;\n\nconst canvas = new Canvas(1920, 1080);\n\ncanvas.save(() => {\n    \n    canvas.translate(500, 500).rotate(Math.PI).scale(0.8).opacity(0.75);\n    \n    canvas.color.fill('red');\n    \n    canvas.line.width(10).dash([20, 40], 10).cap('round').join('bevel');\n    \n    canvas.path.stroke(() => {\n        canvas.shadow.x(5).y(5).blur(10).color('black');\n        canvas.path.rectangle(200, 300, 10);\n    });\n    \n    canvas.font.family('arial').size(24).variantCaps('all-small-caps');\n    canvas.text.align('center').baseline('middle').fill('this is some text');\n\n});\n\ncanvas.clear();\n\n```","readmeFilename":"README.md"}