{"name":"path2d-polyfill","version":"3.2.0","keywords":["Path2D","polyfill","canvas","roundRect"],"author":{"name":"nilzona"},"license":"MIT","_id":"path2d-polyfill@3.2.0","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":"d5887cbe468f36bb16a82d6549f6f801c66000ee","tarball":"http://registry-npm.ywwl.com/path2d-polyfill/download/path2d-polyfill-3.2.0.tgz","fileCount":4,"integrity":"sha512-FWygUVJsEvlup88dGeyO8N60ryWuVc/aPhpEVms+2xVX6jzitkrtqyFxwnMm4hbto2qF96DOQO2z9Fu1nvCoag==","signatures":[{"sig":"MEUCIGyBV0yqPOHViDF82mUEeZcvDyHWtXko5QGrz78oDZJsAiEAmAyf98euojABtlW6PYwAtlvVWr/xA/r8aIWIXEuGj9Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12932,"size":5118,"noattachment":false,"key":"/path2d-polyfill/-/path2d-polyfill-3.2.0.tgz"},"type":"module","_from":"file:path2d-polyfill-3.2.0.tgz","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","actor":{"name":"nilzona_user","type":"user","email":"nilssonanders79@gmail.com"},"email":"nilssonanders79@gmail.com"},"_resolved":"/tmp/93c2aeeaeec021020e991f7180733e95/path2d-polyfill-3.2.0.tgz","_integrity":"sha512-FWygUVJsEvlup88dGeyO8N60ryWuVc/aPhpEVms+2xVX6jzitkrtqyFxwnMm4hbto2qF96DOQO2z9Fu1nvCoag==","repository":{"url":"git+https://github.com/nilzona/path2d-polyfill.git","type":"git"},"_npmVersion":"10.8.2","description":"Polyfills Path2D api for canvas rendering","directories":{},"_nodeVersion":"20.19.2","browserslist":[">0.1%","ie >= 11","last 2 versions","not dead"],"dependencies":{"path2d":"^0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.3.5","jsdom":"^26.1.0","vitest":"^3.2.4","typescript":"^5.8.3","@babel/core":"^7.27.4","@qlik/tsconfig":"^0.3.1","@babel/preset-env":"^7.27.2","@vitest/coverage-v8":"^3.2.4","@rollup/plugin-babel":"^6.0.4"},"_npmOperationalInternal":{"tmp":"tmp/path2d-polyfill_3.2.0_1750775748774_0.7771703783111767","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":1750775748959,"_cnpm_publish_time":1750775748959,"dist-tags":{"beta":"2.0.0-beta.0","latest":"3.2.4"}}