{"name":"path2d-polyfill","version":"0.1.0","keywords":["Path2D","polyfill","canvas"],"author":{"name":"nilzona"},"license":"MIT","_id":"path2d-polyfill@0.1.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":"2582ce6495fb91e4392acb9a9e088d81f34e5131","tarball":"http://registry-npm.ywwl.com/path2d-polyfill/download/path2d-polyfill-0.1.0.tgz","fileCount":5,"integrity":"sha512-zIh8TWwZiNKE5HvGkvSSbnMYev0SAndyc4FpOtGmTtuaymp6/k4iy5uzA71u/CzpIhejr7Gs+jgiPii07Ralfw==","signatures":[{"sig":"MEUCIGyStnXnzsMgDc3v2AhCM4wzsZrXgT4UroFHfM6dvBzdAiEAgLWoqKNVEEmegeBxCKjoxjp8Ax7UxDOIkqSK8JwlFhQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27542,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa/0+xCRA9TVsSAnZWagAAgVoP/0908b2zj2Rx3Xq9buv1\nFHKjAAnCXcrURfG6pBl9rhL4a+ZOAd620VsYU72CvMi8GK258PcbFmLoPQoT\n6cTfJG4GrTSuFHLKltH4Qq8k9kR0qSbJjYIfu15kZAVztIIVa+h9SAbXnA5a\nOa8XKOY7E5C0q67B1RVgNCabYPhwjjLPbJOnaRKF4LEyio73ODbAibcPkV8C\nAzXvOyzx34dCI1URpLLF5ru94ia/MbFr3SyAmnJz/4sPrFY74UF7SdANHzQS\nIxlqL6V/24tz5n+Ue2k7PdBz3gH+rZd0mJJWAP8HT8ykLhUaQyNRrdaxjxPE\n605NVy6DF2FeZTP12J2l5Cdrl2ZjxQckPVSuawNzBrXblPPVoBuKbwgEHLnU\nWcSKmVTzbgaIviamMLANecEBjUcMWPMa9gEnxxGm8PsdiZzFyHfCqPzFvQ6R\n+85YMzhfg87lnPoQNuL6WuDpo2Ro2FsdRu38m5nwI66DVgyI5JXDkc7phyxk\nKm135qKjSgg/a4H+KO+/+5SaRNthhwnuuPLUmF+UmJAczi26TZNDYldwI55U\nEHEgK9HEKWuU6Iejtk5egshI3PfuXgKEct3X4Ras7aU+k+BThrHHgaLx1cJ5\nAJEVuD+QNPLZaTH5eunpwGqbvM1HldM2JeRlsAAzjjj/WerxsdVnj6yfsyFp\n4Wa4\r\n=Thv3\r\n-----END PGP SIGNATURE-----\r\n","size":9103,"noattachment":false,"key":"/path2d-polyfill/-/path2d-polyfill-0.1.0.tgz"},"main":"dist/path2d-polyfill.js","files":["/dist"],"module":"src/index.js","gitHead":"c8591cc4ba942ee935f281e03efeb04f136709bd","scripts":{"lint":"eslint src test rollup.config.js","test":"aw -c aw.config.js","build":"rollup -c --environment BUILD:production","example":"npm run build -- --environment BUILD:debug && simple-server","build:watch":"rollup -c -w","test:coverage":"aw -c aw.config.js --coverage --src \"src/!(index)*.js\""},"_npmUser":{"name":"nilzona","email":"nilssonanders79@gmail.com"},"repository":{"url":"git+https://github.com/nilzona/path2d-polyfill.git","type":"git"},"_npmVersion":"6.0.1","description":"Polyfills Path2D api for canvas rendering","directories":{},"_nodeVersion":"9.5.0","_hasShrinkwrap":false,"devDependencies":{"eslint":"^4.19.1","rollup":"^0.59.1","babel-core":"^6.26.3","babel-eslint":"^8.2.3","after-work.js":"^4.2.1","simple-server":"^1.1.1","babel-register":"^6.26.0","babel-preset-env":"^1.7.0","rollup-plugin-babel":"^3.0.4","eslint-plugin-import":"^2.12.0","rollup-plugin-uglify":"^3.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.1.0_1526681520978_0.19936832759888645","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":1526681521106,"_cnpm_publish_time":1526681521106,"dist-tags":{"beta":"2.0.0-beta.0","latest":"3.2.4"}}