{"name":"path2d-polyfill","version":"1.0.1","keywords":["Path2D","polyfill","canvas"],"author":{"name":"nilzona"},"license":"MIT","_id":"path2d-polyfill@1.0.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":"6f5059ee5633583af4a944d259610668a9d021ef","tarball":"http://registry-npm.ywwl.com/path2d-polyfill/download/path2d-polyfill-1.0.1.tgz","fileCount":10,"integrity":"sha512-NgKM3YN+tRaHvprJQrnCq+0hbCwDI+I1Nxtlma8IveEQGtvmtx2/pTtBnZ9QQfbG5ot9K3Pt6/zubWFtB1izoA==","signatures":[{"sig":"MEQCIBFLIVqMm3u+fdVGj/yw1KInxI9x6MMIcvfNf7a6a8XRAiA5V9eDNQgVLIbSznpQ5ybFbPqPp8Ze250328Xa/qamlQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94129,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfR4KXCRA9TVsSAnZWagAAN64P/05WjCsWy0a3A6ZdqfW/\nWtxueGEZQEUmkcBFbUCsn2nCQk5fLhvwYc9HoTpU7spbA0UXwhJB+8eP1c34\nHZZAkiSYw00RyWq7ud+LsCnuAyNsm4cIVtUwQ2iBNqeVpl3MCTnstuh/7Dka\nN7tgUnIgYO69BE/McvNZodZ/m6Ij5UbGT5QYSettC6S5Q4OFVBOKSSueADdv\nNKExzjepAbpiREZpS3P/UxfUrRamiRG+yJBDAFTdQGK6QNVC6iaqWWfNNQB2\nB3nTDoGhH6GnfuNqmVQ+T7/IZz+gphsoWIEG80HBFQoEnkDIt7+MJfw6gEuh\nUSRjESa2ngI2I2+5Hvu4cbvh+u3KXKZ3kofYT3lYbFODnd7xsrQzkn79Jcvz\nx0H5jIfjXQuA9Zf05GzvtoWCYEf/FgKZIBxtOL4E2CNp8+dLp0A1uAYZPoCq\n3pWkZNXbnRbthPL7OBYB5g/2EULzrgM/LwlbIPbYFUjxNNMF2R2oqPmRWHHp\nbncxZakv/U5idMlGU0ZB0LzfPHqsnV/Z+78fUQe7yCo2E39wqDUhEBrEK+vk\nKCahCaRn3p95t7pk7AK8Mb6Q8IqTXs+TbSrjfZCxZkvMEI501g4nsADR2Dxi\nWlsfbdz4irxD8k7QiDjmMtCNxaohzFeCMvAN4U2fLf/W3DxVZMAn1D6ICfG2\n68zj\r\n=Wjlc\r\n-----END PGP SIGNATURE-----\r\n","size":21743,"noattachment":false,"key":"/path2d-polyfill/-/path2d-polyfill-1.0.1.tgz"},"main":"dist/index.js","module":"dist/index.esm.js","gitHead":"62d79c6b53567966c43ded10e3aba5cf268ae4d6","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":"6.14.6","description":"Polyfills Path2D api for canvas rendering","directories":{},"_nodeVersion":"12.18.3","_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.0.1","chai":"^4.2.0","mocha":"^8.1.2","sinon":"^9.0.2","eslint":"^7.1.0","rollup":"^2.10.9","prettier":"^2.1.1","sinon-chai":"^3.3.0","@babel/core":"^7.5.5","@babel/preset-env":"^7.5.5","rollup-plugin-serve":"^1.0.1","@rollup/plugin-babel":"^5.0.2","rollup-plugin-terser":"7.0.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.3","@rollup/plugin-commonjs":"^15.0.0","rollup-plugin-livereload":"^1.3.0"},"_npmOperationalInternal":{"tmp":"tmp/path2d-polyfill_1.0.1_1598522007400_0.13896715321663922","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":1598522007512,"_cnpm_publish_time":1598522007512,"dist-tags":{"beta":"2.0.0-beta.0","latest":"3.2.4"}}