{"name":"path2d-polyfill","version":"0.2.1","keywords":["Path2D","polyfill","canvas"],"author":{"name":"nilzona"},"license":"MIT","_id":"path2d-polyfill@0.2.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":"0382acf63feb134ecc75a28201be616353ba9e59","tarball":"http://registry-npm.ywwl.com/path2d-polyfill/download/path2d-polyfill-0.2.1.tgz","fileCount":8,"integrity":"sha512-LLGYpHQJIr4x4j2R7VIcbSySkoVWMDUVf7SGz0X84AThGiD5IsIcMjyvBwTcjGuP4S+FnYLcQHDtgJaj9xPK6Q==","signatures":[{"sig":"MEQCIAx+bwXwTXcZFcOTd0IVQLSTaZlWm/e1UH0x/6iXk1Q1AiBBUpAHvwqz/iD9HrX/i9hw1fJNQugYqVDwcsGrp+d+1w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47158,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbFwf9CRA9TVsSAnZWagAArJ4P/jxdDDVD/CWRdKqLvv0I\ncvz2aCofYWeM5Grf/FWs7NpzQzJ15m5dLcFN88vesa3eCFkFzBsnOc6mD54P\n/bDgp/TgUBwKfizasaC/FNZYmgpxRXEUOWQy12wnxXDc5ytMqg7ONF7XDAss\nMeVYnzZ7Y3fm9FzVKUTeblrAcQIaTDbrL6IWGznU3fBtBXir3ckV5L27S/ey\nGpB7SHJ7TRpdgjJEHHE/NXD5jaLztXQBmvIChYDrEyfWpQ7nMBD98xxY51zQ\nNMXI2EGlt3VSepPucloCQoleGbdpqAafciol1MLcfoLF8fS7tCntdkeIuJ6A\nAgK/PCWe65WdR1k1Zzxt5grb3H7Hx0Zp0/5m62pxKv/T+LO6zOXn2MYd1ACa\nNxuBQ+xlZjsRv74gVFPLFnBORVlb2M0VJ3FaSUf6pRo1JBdSq8BSVigg4C35\n1akQjC3J7RQdq51lPoNWg/0QyCr7wjuQi5YjIwB++Z+VaP4OFWaV3eTVyskq\nKy2Phw0183VhA6/GPZ5usOLsEEXNMItST1zS9R/sCuB7xAJyY8qMuxcAGylA\nGaxl+e5ggAxLkzeIe7eURCXo8UgwpKFOtpTN7d5NA1Fb+T7+uI3eKWTKoLB5\n466p6VUi9MXU6qLrGZq+02zI4iZKDdaR+lfgMYRymxjgNIFknEUhFTAEkTDY\nQnEU\r\n=f2lX\r\n-----END PGP SIGNATURE-----\r\n","size":13066,"noattachment":false,"key":"/path2d-polyfill/-/path2d-polyfill-0.2.1.tgz"},"main":"dist/index.js","files":["/dist","/src"],"module":"src/index.js","gitHead":"5e6dac69a4bbf1aad3fef879c4e332d6b75beacf","scripts":{"lint":"eslint src test","test":"aw -c aw.config.js","build":"rm -rf dist/* && parcel build src/index.js","example":"parcel 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":"^4.19.1","after-work.js":"^4.3.2","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.1_1528236028623_0.6414095172119649","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":1528236028687,"_cnpm_publish_time":1528236028687,"dist-tags":{"beta":"2.0.0-beta.0","latest":"3.2.4"}}