{"name":"path2d-polyfill","version":"0.1.2","keywords":["Path2D","polyfill","canvas"],"author":{"name":"nilzona"},"license":"MIT","_id":"path2d-polyfill@0.1.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":"7bf662e942a3883be2a4d010119adf10e32d194b","tarball":"http://registry-npm.ywwl.com/path2d-polyfill/download/path2d-polyfill-0.1.2.tgz","fileCount":5,"integrity":"sha512-ldydgbdiGr7ZwnxtJLBdLl7tjNz7m4WtZDZ9ctRBj5PPVkejmPfWlo2RPVVWlAVJV4Z7Bf+7rSVmo2BRQNYEsw==","signatures":[{"sig":"MEYCIQDot+ArxgieLZyJBNCpBhb0A9e5jKxwNfY6KNdNaXwwPwIhAPZf5i6TykKV7IfEVhwVSv/rGA/vK2bKraoWwsh7nVrV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27545,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbACm7CRA9TVsSAnZWagAAH1cP/RXGSgD7GAI4jD7rtkJQ\nyQDq6gWL3ObpBKkybFgVlH8pZ+GwN78TdfI0oCbgI3mWBsirpf7GkbUOal+q\nOSEGyNJsatEBJtIH5doyPPw1YUUbB3/mAeB8kUJDzQ8O+rkysZBvTzgwgbaY\n99iYBCpsmzgfJ0cqN0z+evlwqbkQ5zddND8LP7vTN+EDTTkiT6ygQ2p1lXue\n/VImsHcf9pUJpoT5inD4KeN9B44mifPm+SDHEviumcz7Lje5YQys+LmHAZTo\n+Py8VbHt1DOijnhl+KxR18bqReYL3Yh5S6ayXdPYUVDAHwydjxIe7lyCViR2\nlincsXo1TxCptggGJQOJJnpbm9huNME3IAZkroVuyejbfE+PIYjDRUlBW1IT\nGfVlszpG7k7fx3I+AqkFYW0XPA4c88On8jf012GP7TmohT6VsfRWPeINTEpV\ngFuKcnKHfqzKZVQf/zODoqby9XyO2BebiXRlPAw9tVuhV3tB/eoYinaTfB6p\nH2Eqg65++fG+3CXu9FvDpLAk5osvUPBBMNT8iyETP44v8coWUXmIILT9bv/a\nzRCf+Ib6Fdeim7Xgx284piaeRyrrHewwa34lwuFpuFtyQc0+huPlSxLWRQHv\nfRjCHLGqF0PWAR2+S1UEVY9eNjcoN99m/T4I2vyxmE6nD+7QEmOiNd6wur5o\n9Naq\r\n=82rq\r\n-----END PGP SIGNATURE-----\r\n","size":9097,"noattachment":false,"key":"/path2d-polyfill/-/path2d-polyfill-0.1.2.tgz"},"main":"dist/path2d-polyfill.js","files":["/dist"],"module":"src/index.js","gitHead":"d0f40cd2d785451f54096a7345bf66c787f1c499","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"},"_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.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.2_1526737338632_0.21153435279642796","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":1526737338756,"_cnpm_publish_time":1526737338756,"dist-tags":{"beta":"2.0.0-beta.0","latest":"3.2.4"}}