{"name":"path2d-polyfill","version":"0.2.2","keywords":["Path2D","polyfill","canvas"],"author":{"name":"nilzona"},"license":"MIT","_id":"path2d-polyfill@0.2.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":"65e40db3f66b258d54fa5dc3ff538a087658a904","tarball":"http://registry-npm.ywwl.com/path2d-polyfill/download/path2d-polyfill-0.2.2.tgz","fileCount":8,"integrity":"sha512-nQMGzwQG/1lS18AOtOYdxGM2gP6EgwoUj1g2gtU165VttEH5/84G93kHrtHJo49eDP1e4ukSeLpnrwI5I3dFrQ==","signatures":[{"sig":"MEQCIB889j1+touMqBIJxLaa0uaexqUIB8hnAJ7lCIO6exjhAiAYF/w80zp2J4G+h4GCNjvyJQ0zb6+Mjw5SYzVJJ9/6KA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47176,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjmNWCRA9TVsSAnZWagAAqx8P/2pvvfwt1dOXDcsbROXN\nO9j5z1MLETF7Zm8mmIOdzkDZa663Xwq4WnHU+BbGD1wih7TaDRZMpTknpcAV\nn6mH/WhoQODigo63V7+x+X57HF3Ht6WMuH+06iF+k+3D1yXVufvY1/lY6U7f\njdIjbRhfvRtx8oo3vTQKPach4T3U4IZ/h7HMbyInefrNVccdtJUC44DWV2KQ\nz+BJjNfERBdLhbQr0ug8+xmSeuunHJ+p2x2K6Zu+/FG6d/4LpaDtNNDbcFBr\nLigQZsTRziWa/pnGfUgcW/OKkrTMTPfh7O5Pw4Nw+vorXI57vDLzZYLCSWpN\n1+o4Wru8IOVrWW6pBrFSODi52sqMvpB35ycZN6QteyM4RVUOLqrHjN2JE5jy\nDG8uRjNUhR80flaV0gjp+jupN1SLgSuenPu/9vGhjW61Z+GYPjYlKQwOhpgM\nOg0TWDn9oO7KcINJdkQAW3i37K/parXWV0BkATxMMr8fvvUTv/EOPSpKzfzA\noCd9XDe4arCnhmLkfRhd5GWdI2Opq0WQc97JfixC62aY0KmEZRp6ihxyHE5f\nAx34FK5eOUJU8qm5hVKbdcHZDxLKK2XH52Q8pzBx9PaRd7/aAnpw6C10b/12\nvZ2I1ABGql6MkcuiC5Cgp3tdQcACaTJAakJudQipEm84GeBm9SUZDRj+vWCB\neAif\r\n=Islk\r\n-----END PGP SIGNATURE-----\r\n","size":13072,"noattachment":false,"key":"/path2d-polyfill/-/path2d-polyfill-0.2.2.tgz"},"main":"dist/index.js","module":"src/index.js","source":true,"gitHead":"bcc5fbef2c35fa9de404d9a7f370144cf4f2627e","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.2_1536058197677_0.08136242152152517","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":1536058197791,"_cnpm_publish_time":1536058197791,"dist-tags":{"beta":"2.0.0-beta.0","latest":"3.2.4"}}