{"name":"path2d-polyfill","version":"0.4.1","keywords":["Path2D","polyfill","canvas"],"author":{"name":"nilzona"},"license":"MIT","_id":"path2d-polyfill@0.4.1","maintainers":[{"name":"nilzona","email":"nilssonanders79@gmail.com"}],"homepage":"https://github.com/nilzona/path2d-polyfill#readme","bugs":{"url":"https://github.com/nilzona/path2d-polyfill/issues"},"dist":{"shasum":"f8528909360ab73e839521a47babef339b8edd4c","tarball":"http://registry-npm.ywwl.com/path2d-polyfill/download/path2d-polyfill-0.4.1.tgz","fileCount":10,"integrity":"sha512-r+jS7FQTmNkuw+AA4qXVntXP521BeUnWpHvgVSuuFZ6j1VaOHicva5bPksYfj8PJkn47HD/hZaEaw8fSHmrAsQ==","signatures":[{"sig":"MEUCIQChzlvkj3LnYvgJscloCr+Zu/dPSeUH26EZ5JTC5h6O5gIgEbTejI+gmhO62tHB8yfGCwcCaShiyN4lYagrc8hfAio=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90100,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJctDJkCRA9TVsSAnZWagAAUEQP/3bbtql9N2Zr8A7HwiKF\nNQLMzW8JFvhxCqf2lMzQXLYysG7isbZvhQ+3VrHCu75XPj8tOL+2+mEMECjW\nOF6ndgW/cL+1rh2pvNbCd5aLIJfVF/REg3Q1j3HFYQ0fWtDoeNKW5dX6rQHH\n5dW/SRRGdFtD7PszWT47Q2ifEf4Ph9dFWfJJ44O83+Z/AOvAYNLtWABlXX7B\nOyKzufnrkPXcPFh6AT3mp/dxqVkJKtAVInqfRGM+bKbtByBYlAVo64ow2oSY\nOrUCMitQlXb0y3Pbvs40qhbKMzszaCVFNGbSna6zhFif6wFJZqjVDUCBSN6j\nyGoshwN4WF3zyw/R6+WUOL3vwm0Oo7g9wCFhYBjSS/a0NHXEWZtC/JWdEavi\nC0Ir5T6GyLua3Itz8nFSkPaEs+GsjDqX+HaffWnExeJ+0Z6N4u5L0f6Iz+7M\n2mbX5EeqIeKP5vYs2EURd/qCe6W3feVZgVHX7TmwTAY6V9EbvzMueGnc/xo0\nG3r35owiQqe72rpLGrS7iEyTAkW5MQGeJI0GIgzhXxCOzzVIKuWoRF3HXOfD\nDoGEH2Jzo3rtr87QCQjGcwd1oSZWENtfiUUvzbGaA3C5pFuNQb0POqmwbhPC\nUFzzPcll9j7i1HeqiYix5vu8JFW2i7PDFYm3giIiyqIF6sd7lfmf5oiUqCvt\nRMag\r\n=qtqE\r\n-----END PGP SIGNATURE-----\r\n","size":21954,"noattachment":false,"key":"/path2d-polyfill/-/path2d-polyfill-0.4.1.tgz"},"main":"dist/index.js","module":"dist/index.esm.js","gitHead":"e8cfb8d0d6bd6568865530fd39b0087099199919","scripts":{"lint":"eslint src test","test":"nyc --reporter=html --reporter=text mocha","build":"rm -rf dist/* && rollup -c","start":"rollup -c -w"},"_npmUser":{"name":"nilzona","email":"nilssonanders79@gmail.com"},"repository":{"url":"git+https://github.com/nilzona/path2d-polyfill.git","type":"git"},"_npmVersion":"5.6.0","description":"Polyfills Path2D api for canvas rendering","directories":{},"_nodeVersion":"8.11.2","_hasShrinkwrap":false,"devDependencies":{"nyc":"^13.3.0","chai":"^4.2.0","mocha":"^6.1.3","sinon":"^7.3.1","eslint":"^5.16.0","rollup":"^1.10.0","sinon-chai":"^3.3.0","@babel/core":"^7.4.3","@babel/preset-env":"^7.4.3","rollup-plugin-babel":"^4.3.2","rollup-plugin-uglify":"^6.0.2","rollup-plugin-commonjs":"^9.3.4","rollup-plugin-live-server":"^1.0.3"},"_npmOperationalInternal":{"tmp":"tmp/path2d-polyfill_0.4.1_1555313251614_0.5587366581485351","host":"s3://npm-registry-packages"},"readme":"# path2d-polyfill\n\n[![CI](https://github.com/nilzona/path2d-polyfill/actions/workflows/ci.yml/badge.svg)](https://github.com/nilzona/path2d-polyfill/actions/workflows/ci.yml)\n\nPolyfills `Path2D` api and `roundRect` for CanvasRenderingContext2D\n\n## Usage\n\nAdd this script tag to your page to enable the feature.\n\n```html\n<script lang=\"javascript\" src=\"https://cdn.jsdelivr.net/npm/path2d-polyfill/dist/path2d-polyfill.min.js\"></script>\n```\n\nThis will polyfill the browser's window object with Path2D features and it will also polyfill roundRect if they are missing in both CanvasRenderingContexst and Path2D.\n\nExample of usage\n\n```javascript\nctx.fill(new Path2D(\"M 80 80 A 45 45 0 0 0 125 125 L 125 80 Z\"));\nctx.stroke(new Path2D(\"M 80 80 A 45 45 0 0 0 125 125 L 125 80 Z\"));\n\n// or ...\nconst path = new Path2D();\npath.roundRect(10, 10, 100, 60, { x: 20, y: 10 }); // Elliptical corners\nctx.stroke(path);\n\n// Mixed corner types\nconst path2 = new Path2D();\npath2.roundRect(10, 10, 100, 60, [{ x: 15, y: 5 }, 10, { x: 5, y: 15 }, 8]);\nctx.stroke(path2);\n```\n\n## Support table\n\n| Method               | Supported |\n| -------------------- | :-------: |\n| constructor(SVGPath) |    Yes    |\n| addPath()            |    Yes    |\n| closePath()          |    Yes    |\n| moveTo()             |    Yes    |\n| lineTo()             |    Yes    |\n| bezierCurveTo()      |    Yes    |\n| quadraticCurveTo()   |    Yes    |\n| arc()                |    Yes    |\n| ellipse()            |    Yes    |\n| rect()               |    Yes    |\n| roundRect()          |    Yes    |\n\n## See it in action\n\nClone [path2d-polyfill](https://github.com/nilzona/path2d-polyfill)\n\n```shell\npnpm install\npnpm dev\n```\n\nopen <http://localhost:5173/> to see the example page.\n\n## Contributing\n\nRecommended to use vscode with the prettier extension to keep formatting intact.\n","publish_time":1555313251825,"_cnpm_publish_time":1555313251825,"dist-tags":{"beta":"2.0.0-beta.0","latest":"3.2.4"}}