{"name":"path2d-polyfill","version":"0.1.1","keywords":["Path2D","polyfill","canvas"],"author":{"name":"nilzona"},"license":"MIT","_id":"path2d-polyfill@0.1.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":"f7c7d9f55a5bc7d185661de57b345c1896a1c563","tarball":"http://registry-npm.ywwl.com/path2d-polyfill/download/path2d-polyfill-0.1.1.tgz","fileCount":5,"integrity":"sha512-fHOCJu+SVGcaGGUOQ1u74vqY9Yj4pr0yM7pzVjoJdl8bBmZdNPfUQ3xEgdOBFvDe4TvXfOVfXr7T4G7TMLn1CQ==","signatures":[{"sig":"MEUCIQCNTVzi54xg8wlDJkTabhc5xGAxQYxiPhafCTYLDks8kAIgFSvhbhRTaQ0KGMhS6xqSxwYuDH8F0gGFrBxMvDoom3k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa/1UGCRA9TVsSAnZWagAAdPcP/iaV39RiTWFarrSbeWyC\npaEyOftbRae9/QvhNPhFYEP6idHCEbI7hXndaw4ARW3Gl+dtwhbFZs4fBMLZ\nXyWERHhSuG1/OxR4ldZ6a4VY1Yd6QdrAkTf7iif97v0JN8Q78FcSL61OhgGB\n4IBb1HfeIEPfU/1YxX0n2IzRBUef701w4PUbJgBY61b+F8ja9AsGuQ1nqj0L\nlNGq3VYv8FbTHqoseIzP9ELLTGmwwkucvtVZ9igAsZ/pILQYZAWahTXXQeUi\n2OSltlCLQ1MRg81A++7oIl9IsU60DFoJRMUjK7BU8tk7RJsa6yq7T7qu9Pua\nwtFa5bET69Zfb6/l5Z/+N/rfrkJWgSLEWH6ESogzK/yit18tXOQX+QjcZKNE\n4xv2D816WbL0LhD/8RE1l5V6Rhq6PD3L/kx7aRvOdUHhYIC+lbcTZmP/k2ym\nQYJwv/i4bwnGe4Gw9qWr9AuHr1RDaX64KDtksL2Qsy2EZddsNH16hpIXBbw9\ndWCRRAniH8jKNVQdC/frRhuETH2dqRQ42I7Nw79fdnEqDWUzVL2wvUFAI/Jc\nz4FXrV3qP2lnr2BrDv96IeKiG3GF0ZATDkwdJQ3VfyImstPRGHpEtKrE71Sx\nGyqIzX7aVKStxm+lMi03zqhLX+H3vbE+2jLtRtMXTJcEwqg23FeGEHv6HG+E\nUZK+\r\n=elWk\r\n-----END PGP SIGNATURE-----\r\n","size":9086,"noattachment":false,"key":"/path2d-polyfill/-/path2d-polyfill-0.1.1.tgz"},"main":"dist/path2d-polyfill.js","files":["/dist"],"module":"src/index.js","gitHead":"6f29a04b6d83e012569f781a48bfccdb878b0a22","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.1_1526682885520_0.4602523263143463","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":1526682885690,"_cnpm_publish_time":1526682885690,"dist-tags":{"beta":"2.0.0-beta.0","latest":"3.2.4"}}