{"name":"path2d-polyfill","version":"0.3.1","keywords":["Path2D","polyfill","canvas"],"author":{"name":"nilzona"},"license":"MIT","_id":"path2d-polyfill@0.3.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":"255c247627171d21eeb5c82df91c3e036e46e5fd","tarball":"http://registry-npm.ywwl.com/path2d-polyfill/download/path2d-polyfill-0.3.1.tgz","fileCount":10,"integrity":"sha512-V7XnFEtVBpyjA+iI7rfEag838Ie8a656B+/V10cIrGNh/QVVYR6I1a2ptXAKCV8ztkzYbYLzx0qhyrpM8OMVSw==","signatures":[{"sig":"MEQCIAx3QsZC8J1e0xpr/6KGBKxYfduPEucLpJH5pMgEq3NRAiB6jl+AGCWCQIscdzibPa8FHcQYv8tbM++SVskBpNurkw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79592,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbq0OoCRA9TVsSAnZWagAAX0oP/RT015aofx/1d7Wtqf2Y\nr7ofDTgsRkBqfeD6lN1Mhxr3pMdEI9z171hEyrVtCGqsAMIhQudQ69eHfdMI\nQZlH/0mHhdMYDdx9/HdJHBO1dqIjNyJqb+e83xlIeCVdiOaLmugYr6KWzpif\nzWD/KrZftZWlAdxZUITI9QyncgqQJ9vlK54bRV/knS6D3vHek2QzzgVzrZ6X\nmdDPR6OmSZZK6At/vWIt/Hy5IKAi6Tb4+uhF41lQcU59SduZyf1C+QDxZ+Q6\nTPFoXOVTj938lPLcU8v9VBnblXpbWSpuRg01FKQXsNJF3W3ypKDJNrLF/roV\nkuTMs+9DJVPww5KvenlVJsORz/bApU9O8brCEdbMy+n6G25rmFFWJ1CyVbHJ\nVHJGP8QDS0Gdc1xyDcToUsiOrU8HS2ZAD+bmLs9GvqjLfFlqBUxoeFM6bOrW\n4RMObkZSR8MgkFNuH0M9XN2i+XmiEUbfsH++Lc3aTX+ug+eqzyElSGQRVndj\n8IXDs6yprqsG9CinW68EWDVBZXz2fSyp7DcZ3K6yLZTEqDY+UjgJKeawE0ml\njo8JX1DnKVIjdqIycfccq6XekhtcIoLw+MufvojlGiZY8eeU6HOkVvnTrnim\nXiR8Xvj1EWi5DAnpiNvgk1LxW3WHxTAspVGIJhU/r4tBTkvjfst50js4dw83\nfAb1\r\n=VYdv\r\n-----END PGP SIGNATURE-----\r\n","size":19536,"noattachment":false,"key":"/path2d-polyfill/-/path2d-polyfill-0.3.1.tgz"},"main":"dist/index.js","module":"dist/index.esm.js","gitHead":"f1cb86e3c2ebf1584967f6e0490227ef50bf6f58","scripts":{"lint":"eslint src test","test":"aw -c aw.config.js","build":"rm -rf dist/* && rollup -c rollup.config.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","rollup":"^0.66.2","@babel/core":"^7.1.0","after-work.js":"^4.3.2","parcel-bundler":"^1.8.1","@babel/preset-env":"^7.1.0","rollup-plugin-babel":"^4.0.3","eslint-plugin-import":"^2.12.0","rollup-plugin-uglify":"^6.0.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.3.1_1537950630756_0.9719789865741297","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":1537950630934,"_cnpm_publish_time":1537950630934,"dist-tags":{"beta":"2.0.0-beta.0","latest":"3.2.4"}}