{"name":"path2d-polyfill","version":"3.2.2","keywords":["Path2D","polyfill","canvas","roundRect"],"author":"nilzona","license":"MIT","_id":"path2d-polyfill@3.2.2","maintainers":[{"name":"nilzona_user","email":"nilssonanders79@gmail.com"}],"homepage":"https://github.com/nilzona/path2d-polyfill#readme","bugs":{"url":"https://github.com/nilzona/path2d-polyfill/issues"},"dist":{"shasum":"7e73ce0e2584f6afe3c1271502e2e3ee8551d903","tarball":"http://registry-npm.ywwl.com/path2d-polyfill/download/path2d-polyfill-3.2.2.tgz","fileCount":4,"integrity":"sha512-4txbPkD7ZU6SdaR5g3qYgEDlOQuCj87AwzcUr5St1dTL/zSGYGTmylIcasD0S/e5Fxa9bqR0753IuTlv5c5DGg==","signatures":[{"sig":"MEYCIQCDsol7suI7ZMnqdEB2zQXRofet3gZ0Lh+0lwysnXcXjgIhAMEHiYpbAlAH+PPnkjc0iHiW65M6yMHPZW3P67pb2KKx","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12339,"size":4850,"noattachment":false,"key":"/path2d-polyfill/-/path2d-polyfill-3.2.2.tgz"},"type":"module","browser":"dist/path2d-polyfill.min.js","exports":{"browser":"./dist/path2d-polyfill.min.js"},"scripts":{"dev":"vite","lint":"cd ../.. && pnpm exec eslint ./packages/path2d-polyfill","test":"vitest run","build":"vite build && cp dist/path2d-polyfill.min.js test/path2d-polyfill.min.js","preview":"vite preview","test:watch":"vitest","check-types":"tsc --noEmit","format:check":"cd ../.. && pnpm exec prettier --check 'packages/path2d-polyfill/**' --ignore-unknown","format:write":"cd ../.. && pnpm exec prettier --write 'packages/path2d-polyfill/**' --ignore-unknown","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"nilzona_user","email":"nilssonanders79@gmail.com"},"repository":{"url":"git+https://github.com/nilzona/path2d-polyfill.git","type":"git"},"description":"Polyfills Path2D api for canvas rendering","directories":{},"_nodeVersion":"24.16.0","browserslist":[">0.1%","ie >= 11","last 2 versions","not dead"],"dependencies":{"path2d":"^0.3.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^8.0.16","jsdom":"^29.1.1","@babel/core":"^7.29.7","@qlik/tsconfig":"^1.0.0","@babel/preset-env":"^7.29.7","@vitest/coverage-v8":"^4.1.9","@rollup/plugin-babel":"^7.1.0"},"_npmOperationalInternal":{"tmp":"tmp/path2d-polyfill_3.2.2_1781603828186_0.8322390594981361","host":"s3://npm-registry-packages-npm-production"},"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":1781603828323,"_cnpm_publish_time":1781603828323,"dist-tags":{"beta":"2.0.0-beta.0","latest":"3.2.4"}}