{"id":28285359,"url":"https://github.com/forceuser/svg-path-fn","last_synced_at":"2025-06-16T07:30:57.825Z","repository":{"id":36768707,"uuid":"230182601","full_name":"forceuser/svg-path-fn","owner":"forceuser","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-27T10:40:19.000Z","size":1524,"stargazers_count":2,"open_issues_count":19,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-21T18:17:05.083Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://forceuser.github.io/svg-path-fn/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/forceuser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-26T02:42:01.000Z","updated_at":"2023-04-27T10:40:24.000Z","dependencies_parsed_at":"2023-01-17T04:45:34.132Z","dependency_job_id":null,"html_url":"https://github.com/forceuser/svg-path-fn","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/forceuser/svg-path-fn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forceuser%2Fsvg-path-fn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forceuser%2Fsvg-path-fn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forceuser%2Fsvg-path-fn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forceuser%2Fsvg-path-fn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forceuser","download_url":"https://codeload.github.com/forceuser/svg-path-fn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forceuser%2Fsvg-path-fn/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260119237,"owners_count":22961497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-21T18:17:02.659Z","updated_at":"2025-06-16T07:30:57.813Z","avatar_url":"https://github.com/forceuser.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# svg-path-fn\n\n[![npm repository](https://img.shields.io/npm/v/svg-path-fn.svg)](https://www.npmjs.com/package/svg-path-fn)\n[![Build Status](https://travis-ci.org/forceuser/svg-path-fn.svg?branch=master)](https://travis-ci.org/forceuser/svg-path-fn)\n[![Coverage Status](https://img.shields.io/codecov/c/github/forceuser/svg-path-fn/master.svg)](https://codecov.io/gh/forceuser/svg-path-fn)\n[![Known Vulnerabilities](https://snyk.io/test/github/forceuser/svg-path-fn/badge.svg)](https://snyk.io/test/github/forceuser/svg-path-fn)\n\nLibrary for creating functions based on svg path\n\n## Installation\n\n#### Install as npm package\n\n```shell\nnpm i svg-path-fn --save\n```\n\n#### Or simply download \\*.js file\n\n[svg-path-fn.js@0.0.196](https://github.com/forceuser/svg-path-fn/releases/download/0.0.196/svg-path-fn.js)\n\n[svg-path-fn.modern.js@0.0.196](https://github.com/forceuser/svg-path-fn/releases/download/0.0.196/svg-path-fn.modern.js) *for modern browsers only (see [.browserlistrc](https://github.com/forceuser/svg-path-fn/blob/master/.browserslistrc))*\n\n#### Or just load from CDN\n\n```html\n\u003cscript src=\"//cdn.jsdelivr.net/npm/svg-path-fn@0.0.196/dist/svg-path-fn.js\"\n    integrity=\"sha512-EXK7F0GC9G3YHfHZv2LbOaOB//ySVXhJwD/2FVQppwDCLnoPu/ls0wM25ZbIeMjMsQa+DiiQfxqW7Nyjp8uaNA==\" crossorigin=\"anonymous\"\u003e\n\u003c/script\u003e\n```\n\n*if you need only modern browsers then use script below:*\n\n```html\n\u003cscript src=\"//cdn.jsdelivr.net/npm/svg-path-fn@0.0.196/dist/svg-path-fn.modern.js\"\n    integrity=\"sha512-H1BCyTJhc9/4EBFQEYCO472ny3pM0a8xbi1ObAghqvBpzIJoIsdOlt8oXnlwcFUchzobXZeomZMKYreSoIWEUA==\" crossorigin=\"anonymous\"\u003e\n\u003c/script\u003e\n```\n\nAnd then use **svgPathFn** as global variable\n```html\n\u003cscript\u003e\n\tconsole.log(svgPathFn);\n\u003c/script\u003e\n```\n\n## Example\n\nRun example with [runkit](https://npm.runkit.com/svg-path-fn)\n\n```js\nconst svgPathFn = require(\"svg-path-fn\");\nconst path1 = svgPathFn(`M 213.1,6.7\nc -32.4-14.4-73.7,0-88.1,30.6\nC 110.6,4.9,67.5-9.5,36.9,6.7\nC 2.8,22.9-13.4,62.4,13.5,110.9\nC 33.3,145.1,67.5,170.3,125,217\nc 59.3-46.7,93.5-71.9,111.5-106.1\nC 263.4,64.2,247.2,22.9,213.1,6.7\nz`);\n\nconsole.log(path1.val(0.42), path1.length);\n\nconst path2 = svgPathFn(`M 10 80 Q 52.5 10, 95 80 T 180 80`);\n\nconsole.log(path2.val(0.2), path2.length);\n\nconst path3 = svgPathFn(`M 10 315\nL 110 215\nA 30 50 0 0 1 162.55 162.45\nL 172.55 152.45\nA 30 50 -45 0 1 215.1 109.9\nL 315 10`);\n\nconsole.log(path3.val(0.6), path3.length);\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforceuser%2Fsvg-path-fn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforceuser%2Fsvg-path-fn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforceuser%2Fsvg-path-fn/lists"}