{"name":"path2d-polyfill","version":"0.4.0","keywords":["Path2D","polyfill","canvas"],"author":{"name":"nilzona"},"license":"MIT","_id":"path2d-polyfill@0.4.0","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":"1917973daaf935aabd408f4d27202efb27a584ce","tarball":"http://registry-npm.ywwl.com/path2d-polyfill/download/path2d-polyfill-0.4.0.tgz","fileCount":10,"integrity":"sha512-w7p7/btHgVk2i43LKnMZTrbvsq08rPeyBRc6WI3POy/hBbblqou7HQYFRZjcz/7En9PvLx7K2v1Uk92u0mYM3w==","signatures":[{"sig":"MEUCIQCSCPurjCm7eVSe4NJj8wpTby9cdyLtxLrdSwA5kA0EnAIgSEGr6JlOOqi9K09DPB3JrE99UWP3wQnNyLpfKumvS/Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89395,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcsPwJCRA9TVsSAnZWagAA6iIP/2V0jKPngTDBr1hc0BbI\nOMVYO28vFHrkQXMaBb1yDFJ1Hni1YHm+/59jwxpUMdb155Qv9dcml7AAokC9\nN8OjIS6JALk3Q7qrP+iIdpZF4V5aHdec3k83Eg5KZLmX7qaZyCcx03xLoQo8\n+D0Ah7PUtczXYU3s5FcnvdqCBiPt/pmotOyQGapNWnKpyaCfvHy4KlU1Ldi2\nxSQFNyiiFs4yqYZyRKGALjJDHC+RhD43EXa1wIjT5PthvNIfHIPqMJisbOXD\nLSs/kh4gKN3hoBnpKbLP6DmPpuH3pLhOyMJEgvD4LRIoG8gVsrzqdp1zOC1M\nHJ0rEy5aHbRq5FrnhoPVyWujuRe+CtbeuPCGy2FsOunutrYYBeSq/HTL/FXZ\nRY9n7pEwSWrqadwwkmSVnxySFBPTP5uaoP2SAeM/35WOY0tK+3NF2UtpKGLq\nLB2SYSBzn6ZyDOfEPzXEk4mP3cbvWIo5/ThZX6aymYHf0PnI7XuUjmNesZV8\n5u7E19YgJ6RHlb+Lx9VBf4Jgc/m+r6Do2gUphjaTstOzEi28nm9YCxPsBIJg\nGuNCgrizXHWGo+HhXxLbsrDmK5ImTugxOpmoVwRGfqFJskLznpBoMnCsJwLW\nX/+P0rJpQex/nXCrYRXx9zHTWH78+0j6qwq+Uz5uQZgxWeHdNYerVcolsgTG\nB85d\r\n=XC5D\r\n-----END PGP SIGNATURE-----\r\n","size":21731,"noattachment":false,"key":"/path2d-polyfill/-/path2d-polyfill-0.4.0.tgz"},"main":"dist/index.js","module":"dist/index.esm.js","gitHead":"f1ceae51093f984fb6ac79c312f65864f9070974","scripts":{"lint":"eslint src test","test":"aw -c aw.config.js","build":"rm -rf dist/* && rollup -c rollup.config.js","example":"parcel example/index.html","build:watch":"parcel src/index.js","test:coverage":"aw -c aw.config.js --coverage"},"_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":{"eslint":"^5.16.0","rollup":"^1.10.0","@babel/core":"^7.4.3","parcel-bundler":"^1.12.3","@after-work.js/aw":"^6.0.3","@babel/preset-env":"^7.4.3","rollup-plugin-babel":"^4.3.2","eslint-plugin-import":"^2.16.0","rollup-plugin-uglify":"^6.0.2","babel-plugin-istanbul":"^5.1.1","eslint-config-airbnb-base":"^13.1.0"},"_npmOperationalInternal":{"tmp":"tmp/path2d-polyfill_0.4.0_1555102728700_0.3223343045256666","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":1555102728821,"_cnpm_publish_time":1555102728821,"dist-tags":{"beta":"2.0.0-beta.0","latest":"3.2.4"}}