Gathering detailed insights and metrics for @liammartens/svg-path-properties
Gathering detailed insights and metrics for @liammartens/svg-path-properties
Gathering detailed insights and metrics for @liammartens/svg-path-properties
Gathering detailed insights and metrics for @liammartens/svg-path-properties
Pure Javascript alternative to path.getPointAtLength(t) and getTotalLength() functions. Works with Canvas & Node
npm install @liammartens/svg-path-properties
Typescript
Module System
Node Version
NPM Version
76.1
Supply Chain
93.1
Quality
75.2
Maintenance
100
Vulnerability
99.6
License
TypeScript (91.78%)
HTML (7.07%)
JavaScript (1.14%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
274 Stars
215 Commits
18 Forks
6 Watchers
7 Branches
10 Contributors
Updated on Jun 15, 2025
Latest Version
1.3.0-beta.0
Package Id
@liammartens/svg-path-properties@1.3.0-beta.0
Unpacked Size
189.32 kB
Size
48.73 kB
File Count
47
NPM Version
9.6.7
Node Version
18.17.1
Published on
Sep 08, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
17
Pure Javascript alternative to getPointAtLength(t) and getTotalLength() functions. Works with Canvas objects and when Node
JavaScript can access to path elements properties in a browser, such as its length and the point at a given length. Unfortunately, this can't be achieved using a Canvas element or when working with node. This library can be used to replace this need. It has no dependencies on other JavaScript libraries.
To use with npm, just type
npm install svg-path-properties
You can use it int he browser directly by including svg-path-properties.min.js from the dist directory
<script src="svg-path-properties.min.js"></script>
The available methods are:
const path = require("svg-path-properties");
const properties = new path.svgPathProperties("M0,100 Q50,-50 100,100 T200,100");
const length = properties.getTotalLength();
const point = properties.getPointAtLength(200);
const tangent = properties.getTangentAtLength(200);
const allProperties = properties.getPropertiesAtLength(200);
const parts = properties.getParts();
const path = require("svg-path-properties");
const properties = new path.svgPathProperties("M0,100 Q50,-50 100,100 T200,100");
import { svgPathProperties } from "svg-path-properties";
const properties = new svgPathProperties("M0,100 Q50,-50 100,100 T200,100");
Once the script tag has been included,
const properties = new svgPathProperties.svgPathProperties("M0,100 Q50,-50 100,100 T200,100");
Since svgPathProperties is a class, using new is the correct way to initilize it. For backwards compatibility reasons, the object can be get without it:
const properties = svgPathProperties("M0,100 Q50,-50 100,100 T200,100");
The TypeScript declaration file is available too, since version 0.5.0 From version 1.0.0, the whole library has been rewritten using TypeScript, and the types are auto-generated.
Some parts of the code are taken from other libraries or questions at StackOverflow:
For Bézier curves:
For path parsing:
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
4 existing vulnerabilities detected
Details
Reason
Found 5/23 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More