{"name":"path2d-polyfill","version":"1.1.4","keywords":["Path2D","polyfill","canvas"],"author":{"name":"nilzona"},"license":"MIT","_id":"path2d-polyfill@1.1.4","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":"ea705f7cca2f74b19d610f0bc4f7899e731e4f19","tarball":"http://registry-npm.ywwl.com/path2d-polyfill/download/path2d-polyfill-1.1.4.tgz","fileCount":10,"integrity":"sha512-7KSbN/1Cp0z7k4mIqvg0bnjpKX14bGCyJ1H+LLFJaNHv8YpPN+Zrl1vsCIxdnTF77QsgtMUD6eM+Gg25nOcZkA==","signatures":[{"sig":"MEQCICejnzxHqlGW7Z5FCSa9qeUsrSjufw0DyiJKadOjBiX3AiBxzx/arLIP6BolYYA8CCpeS3YN71u3nutJ14U/AfGdCQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":98378,"size":22569,"noattachment":false,"key":"/path2d-polyfill/-/path2d-polyfill-1.1.4.tgz"},"main":"dist/index.js","module":"dist/index.esm.js","gitHead":"c80cb333c8702ac3048f71ea489c8b0602462be8","scripts":{"lint":"eslint src test","test":"nyc --reporter=html --reporter=text mocha","build":"rm -rf dist/* && rollup -c","start":"rollup -c -w","format":"prettier . --write"},"_npmUser":{"name":"nilzona","email":"nilssonanders79@gmail.com"},"repository":{"url":"git+https://github.com/nilzona/path2d-polyfill.git","type":"git"},"_npmVersion":"6.14.15","description":"Polyfills Path2D api for canvas rendering","directories":{},"_nodeVersion":"12.22.7","_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.0.1","chai":"^4.3.4","mocha":"^8.3.2","sinon":"^10.0.0","eslint":"^7.25.0","rollup":"^2.47.0","prettier":"^2.1.1","sinon-chai":"^3.6.0","@babel/core":"^7.14.0","@babel/preset-env":"^7.14.1","rollup-plugin-serve":"^1.1.0","@rollup/plugin-babel":"^5.3.0","rollup-plugin-terser":"7.0.2","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","@rollup/plugin-commonjs":"^18.1.0","rollup-plugin-livereload":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/path2d-polyfill_1.1.4_1635577133679_0.05781687028090787","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":1635577133820,"_cnpm_publish_time":1635577133820,"dist-tags":{"beta":"2.0.0-beta.0","latest":"3.2.4"}}