{"name":"path2d-polyfill","version":"0.1.3","keywords":["Path2D","polyfill","canvas"],"author":{"name":"nilzona"},"license":"MIT","_id":"path2d-polyfill@0.1.3","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":"48177a96711885cdd671d6840c46dd66fa7081c2","tarball":"http://registry-npm.ywwl.com/path2d-polyfill/download/path2d-polyfill-0.1.3.tgz","fileCount":5,"integrity":"sha512-ldso1uuS2A2QMyOSypAg3idiJs1/oFNPe6L+tYQlZr84l5ikHVZjI2OQoxLHN1dbIuF1UBO0A6C3lGNDFIyoyA==","signatures":[{"sig":"MEUCIQCg4MJ6p6YrLw2hqPsQOWrRnv1P4vjmHy9+cown3Ull3AIgZOxelMexBY61ozeXMbbZSRHvrqrVDZ4I8kT48QUsaDU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27244,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbBDGqCRA9TVsSAnZWagAAfikP/2hx8Na8CWz5rAokZngw\nYsyXi+EjCHwIOpPGe4kIksM0Rl4emhhuvXFm058PmMzB0dopIsUA/QBNGyKn\nAGW1SB4HMbwxQoFrG4GSjbmqbtfdSvAyxOND6rFUBWe40Ly+V4/hBnMtHzVl\nS1rBGDmTQogFI/ZSusncSJJsOk4/6oJzRlkiho/gOI8Bsrfq88+y0j8/f8mb\n1OPsjJ+DdPxYYaA4yycr9rlwrySezhJeyIE61expAIOu55MmFIDYPQFZULiT\n4S9UG+y3RLqd1XypBW4oMVW4qxenoHvCQHNEUzppBejjCYzZ89kgpgBXbdZF\nfuXSJZyQ8EV2Xj/dHBS9LCTLrBB/rswFW8Ig0FsYQCihoi8cTt0xL4Iu2uWF\nO9AzEb6sKifs2shLIDGdmxoFvXqQSHDfBu681QNtP1UyoXT4v0/Gw66u0N06\neEC1wGl2s+Xd4moXTtJfvI0EbqpQM3MHBI5jbou9QBBApJguA23CjZBzA3tD\nWzbzMpasIc0jAFKC7m/QITVZ0kR9JGrz0p2YVifVMjCp30rJMi+0wJyCx1oF\nTi4uw51FQYyqCq5eo80XrVLB3IZ+omTaNmUOjCpPhA9MFYR8Bns7pnik8DFa\nrSLx5BcGrS8abUv4hsWFDF+84FKec2TfcbshvcOBGK56YcjVsZhiO+9DEU7r\nBNqR\r\n=MXqs\r\n-----END PGP SIGNATURE-----\r\n","size":8989,"noattachment":false,"key":"/path2d-polyfill/-/path2d-polyfill-0.1.3.tgz"},"main":"dist/path2d-polyfill.js","files":["/dist"],"module":"src/index.js","gitHead":"1ebe3d7a7c7bc78487a287021ac4baeac4414846","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"},"_npmUser":{"name":"nilzona","email":"nilssonanders79@gmail.com"},"repository":{"url":"git+https://github.com/nilzona/path2d-polyfill.git","type":"git"},"_npmVersion":"5.6.0","description":"Polyfills Path2D api for canvas rendering","directories":{},"_nodeVersion":"8.11.2","_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.3_1527001513345_0.8937754960734301","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":1527001513425,"_cnpm_publish_time":1527001513425,"dist-tags":{"beta":"2.0.0-beta.0","latest":"3.2.4"}}