{"name":"path2d-polyfill","version":"2.0.0-beta.0","keywords":["Path2D","polyfill","canvas"],"author":{"name":"nilzona"},"license":"MIT","_id":"path2d-polyfill@2.0.0-beta.0","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":"da130e5468f0aa17496f129fd2b015529459ce8b","tarball":"http://registry-npm.ywwl.com/path2d-polyfill/download/path2d-polyfill-2.0.0-beta.0.tgz","fileCount":7,"integrity":"sha512-fnSFgjakSgmw4Q8eLSwqXOx+IPf6MP0Fcy9Szajyb9hOUkvVLVhPzFL0F77Gm/8QCV9EP03/rIWr99E6AdkTtw==","signatures":[{"sig":"MEUCIQD03+0Q65EkjPHd33jtJEwRf8cyTBPCENwV3TtvtwN30gIgAfFOClGhfnVxLxvIDZ589tsYeL9E7yZAtViiQ9eMDQg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":76834,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvE9qACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQnQ/+PYnABOWrKLpY1bgky/SWkmOAFjHDQhrlgzs9ZqMDQM7Afc4q\r\nTGUvGQR4Av8cPET4AvrW3l835LjIzP6SPrT6kbKy2wRqYH8KexvmtK38phpF\r\nw8ftaP7wbw4DIFl9OzD3D0nxMnBOsabR6l9yLoJSv5GqKwaG25vn2LISOQ9r\r\nfp2UQMaxyJjwp5hli9uh7Ug6gNmquQ8h2PZrLeF/sTXgAKT/Ao9zibNhQamL\r\nbqCX5fssIywlYxxnHJplqXAVsqNgaAyeBQBA+Sgq2rnDlekXp8vt7i5eO2wJ\r\nWHLxiqZtbaV1Lphl/ri80Z4BPXdW2cgVpeOli0NGcTO6CMjsWB64hlqp28lD\r\ncA+KyUAPQhmtEAPn5TgNnoB4kVmjjko5TuS3qpS/p93Q7/H86KSuJhdcsk2P\r\nftLSLY3ZLk1gWg9OLwBW24G11nvQr9XfY8onKsdm5drKa6qQngiTkg3fSMPS\r\n3PHd8sW7D5wz5BQ3zEq/wVX7b/LcV0v8T8LJhAq9CWm6MpUqzQkLDsNMfQeH\r\nVyFF+CstHw+M0zuQKLF/hOuu/PJN1BI+RrbpE5ImPa3RpkieiYJOVsVS+YB5\r\nLdM080j0WgqNjEKNMluW7mTEMuGgfDZkQNUk1W3Tq7+HFpXYspzz2MfSL9Eq\r\nlQaM4KUqvws4QaCTuH4Brzt7tgengstm+ME=\r\n=a3WP\r\n-----END PGP SIGNATURE-----\r\n","size":12945,"noattachment":false,"key":"/path2d-polyfill/-/path2d-polyfill-2.0.0-beta.0.tgz"},"main":"dist/path2d-polyfill.cjs.js","module":"dist/path2d-polyfill.esm.js","browser":"dist/path2d-polyfill.min.js","engines":{"node":">=8"},"gitHead":"fb95d3940675ec9945f8ff1a3d64e01e21cb64e5","scripts":{"lint":"eslint .","test":"ts-mocha test/*.spec.ts","build":"rm -rf dist/* && rollup -c","start":"rollup -c -w","prepare":"husky install","release":"release-it","test:watch":"ts-mocha --watch test/*.spec.ts","check-types":"tsc --noEmit","format:check":"prettier --check \"./**\"","format:write":"prettier --write \"./**\"","test:coverage":"nyc --reporter=html --reporter=text --reporter=text-summary yarn test"},"_npmUser":{"name":"nilzona","email":"nilssonanders79@gmail.com"},"repository":{"url":"git+https://github.com/nilzona/path2d-polyfill.git","type":"git"},"_npmVersion":"9.2.0","description":"Polyfills Path2D api for canvas rendering","directories":{},"_nodeVersion":"19.3.0","dependencies":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"15.1.0","chai":"4.3.7","husky":"8.0.2","mocha":"10.2.0","sinon":"15.0.1","eslint":"8.31.0","rollup":"3.9.1","prettier":"2.8.1","ts-mocha":"^10.0.0","release-it":"15.6.0","sinon-chai":"3.7.0","typescript":"^4.9.4","@babel/core":"7.20.7","@types/chai":"^4.3.4","lint-staged":"13.1.0","@types/mocha":"^10.0.1","@types/sinon":"^10.0.13","@commitlint/cli":"17.3.0","@babel/preset-env":"7.20.2","@types/sinon-chai":"^3.2.9","rollup-plugin-serve":"2.0.2","@rollup/plugin-terser":"0.2.1","eslint-config-prettier":"8.6.0","rollup-plugin-livereload":"2.0.5","@rollup/plugin-typescript":"10.0.1","@typescript-eslint/parser":"5.48.0","@commitlint/config-conventional":"17.3.0","@typescript-eslint/eslint-plugin":"5.48.0","@release-it/conventional-changelog":"5.1.1"},"_npmOperationalInternal":{"tmp":"tmp/path2d-polyfill_2.0.0-beta.0_1673285482706_0.5369250271494337","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":1673285482880,"_cnpm_publish_time":1673285482880,"dist-tags":{"beta":"2.0.0-beta.0","latest":"3.2.4"}}