{"name":"path2d-polyfill","version":"0.2.0","keywords":["Path2D","polyfill","canvas"],"author":{"name":"nilzona"},"license":"MIT","_id":"path2d-polyfill@0.2.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":"e4f3e77ced4f09c886c92ee4720e743598889070","tarball":"http://registry-npm.ywwl.com/path2d-polyfill/download/path2d-polyfill-0.2.0.tgz","fileCount":8,"integrity":"sha512-EydmauY4B6/n6hy5pCvbTCIBc4djcSaABc7BwBng019BYa3QvPOk5kk5smzsPBl6jJ49p5lLY4EwlwYckoRLuA==","signatures":[{"sig":"MEUCICL9oZ72XfUDR/yMrJwfCZ+TDPvI6b4q8QN+ed4FdOCQAiEAm5wzB2ZTQ95GH0JbBv/daWgE2vSBlM0AngefYC+/mIE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47224,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbFbc6CRA9TVsSAnZWagAAGq0P/30r00fO48wrKR8PgfJM\ncJ9WtxUBdC4KQ1r/6HdebdsVgwhuatKAIYyANrgruQmfuKJWQZqwT0tjALaU\nh7bCNgq+2pebPnZB6hCwO0mz4FkiAgjooqO9cHohaUxozcqEbaIQahiE4Ckj\nzNQVqp521YgNryBx+5v4KTs4npiFFDBwDltKPXJN/jSr6t+zjYDY8UtXyAiy\n1wjGQ/Icgeg+0EMJQjn1MxF75O0Qp2rM4GhSY0pVt4cUAZF+cqUXvLMjFWM9\nq746mwAqoP/uF0ebI+A7dPagpdx4tVe7V82AKmQE6ITGkw4Z4gmpKA3KpWJD\nl/5CYUZiHfpV2JaQJc5JyxGpnqY8n35ieDCcvO9y8ZtFmLU79EVBu8vYKpSK\nWq1WScodY60PEp4XJgMb9FYqAx6LlY2pM5siyoyUrucZk32RICs/sdPRajfa\nnc5Duss3krH1HQk0Sw9OuCeL32/F5xvjbpSa+RGH0+zf7cBKSdaM09ALPv8v\n51ZnSzWDeID1S2KRZCbqZab+08LAUV2p/Mwr/BTGvLPj5e+L9F6iHRQxZggx\nkN0V3u3nOha2dNMg0AFrzfayWX18AHbD9lKOu2qjWWIofLCEZY4XepUDhUBP\npfARKkaQlBPwMwACY+/riOm7dDXd0VC6joEnlE2vcVmgiHspW4yk1FNB145x\niAVx\r\n=2lVI\r\n-----END PGP SIGNATURE-----\r\n","size":13100,"noattachment":false,"key":"/path2d-polyfill/-/path2d-polyfill-0.2.0.tgz"},"main":"dist/path2d-polyfill.js","files":["/dist","/src"],"module":"src/index.js","gitHead":"f30f653623078e101da215ba828fa5bed1d7db2b","scripts":{"lint":"eslint src test","test":"aw -c aw.config.js","build":"parcel build src/index.js","example":"npm run build -- --environment BUILD:debug && simple-server","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":"^4.19.1","after-work.js":"^4.3.2","simple-server":"^1.1.1","parcel-bundler":"^1.8.1","eslint-plugin-import":"^2.12.0","babel-plugin-istanbul":"^4.1.6","eslint-config-airbnb-base":"^12.1.0","eslint-plugin-chai-expect":"^1.1.1"},"_npmOperationalInternal":{"tmp":"tmp/path2d-polyfill_0.2.0_1528149817714_0.3056796375757549","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":1528149817785,"_cnpm_publish_time":1528149817785,"dist-tags":{"beta":"2.0.0-beta.0","latest":"3.2.4"}}