{"name":"path2d-polyfill","version":"1.1.2","keywords":["Path2D","polyfill","canvas"],"author":{"name":"nilzona"},"license":"MIT","_id":"path2d-polyfill@1.1.2","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":"8d0e06b8c08c8408f1db65f9ab0ab1081194653b","tarball":"http://registry-npm.ywwl.com/path2d-polyfill/download/path2d-polyfill-1.1.2.tgz","fileCount":10,"integrity":"sha512-rUiPojuR3oOVDf/yqtwPwJaadCLHA1g1m/sMoWosKENluxeZAJ/pvchfuwR9jD0akSvE57qCBAI+ETlDxg9qhQ==","signatures":[{"sig":"MEQCIHsEX5+caIn1Yq/9DMqGFsQZFPYDlI07TugCuUKHA2lZAiB36XtA8HMlH1e3ZaNiO5gxdZkFG7/BJO9gHFrsIb2ahw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":98378,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkZqdCRA9TVsSAnZWagAAnGsP/2/NnBo3kSFzOGUIywv3\noxPqfcFlPsOiHy+pvlUp7w3kEav2bl3fnsAoWOo9G4j4RkuttS5lQLYdx+t8\nA6T2IVK3nnJdZG7vGScri+gKzkLh2Z4hjljjYEcEC+XvMwriH5nNYoaEMlxt\n366+itm06jlhknBrvCaNkDXJ5CbOQNq4haDtGCxKPmdds/CY6HQSWrLKH9c7\n/Vof3O8Efgx9s/hREV6hYtwLCavo2O6p6RES2/3qUeQJ/WFwDpGeS86nGskj\ngGqrVdN/hlB4ny1UeLm9sdlvKPg8uvabvy5SRLo3/fTLcnX8Kzl8uVcVYhrM\nfxdUvRtbSl3B8W3XdV9iDSiJ1xSBhp01OLba0IYoVyvq4LPjdAVY85zihk6k\n662faGyqFLaA/agd3qml2Sk2BHzmI3ApFaNaic9utn7VWnMdHmmw9fcYMRcF\nh2jPGfHBTvs2c+EiwSVTLKf77+IpnXbUy+D+sM1hjjOaWqWVOCEOIclNDVy/\n3S/KXzUX7dk2TqpiXG/t6jAwRh32yT5DfONX4N8YAtSlC1hZP9sxT0MYmgu9\nqVgRwA7pQ7LIwaGHx7LXQTB0wVDLKq4LcoVqO4uuYHAN7UMssrZTsOe7sG6g\n6EbVfwfgxwUNv0Ab54bUpkvzrdzZyq+MRGto0H05N8lqDvB85XrgW5ZxXqPl\niekg\r\n=l0di\r\n-----END PGP SIGNATURE-----\r\n","size":22568,"noattachment":false,"key":"/path2d-polyfill/-/path2d-polyfill-1.1.2.tgz"},"main":"dist/index.js","module":"dist/index.esm.js","gitHead":"a6cf9d6dbc54b6c4abab7ba8553b7817010f54d0","scripts":{"lint":"eslint src test","test":"nyc --reporter=html --reporter=text mocha","build":"rm -rf dist/* && rollup -c","start":"rollup -c -w","format":"prettier . --write"},"_npmUser":{"name":"nilzona","email":"nilssonanders79@gmail.com"},"repository":{"url":"git+https://github.com/nilzona/path2d-polyfill.git","type":"git"},"_npmVersion":"6.14.12","description":"Polyfills Path2D api for canvas rendering","directories":{},"_nodeVersion":"12.22.1","_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.0.1","chai":"^4.3.4","mocha":"^8.3.2","sinon":"^10.0.0","eslint":"^7.25.0","rollup":"^2.47.0","prettier":"^2.1.1","sinon-chai":"^3.6.0","@babel/core":"^7.14.0","@babel/preset-env":"^7.14.1","rollup-plugin-serve":"^1.1.0","@rollup/plugin-babel":"^5.3.0","rollup-plugin-terser":"7.0.2","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","@rollup/plugin-commonjs":"^18.1.0","rollup-plugin-livereload":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/path2d-polyfill_1.1.2_1620155036925_0.35528727818740036","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":1620155037098,"_cnpm_publish_time":1620155037098,"dist-tags":{"beta":"2.0.0-beta.0","latest":"3.2.4"}}