parse-svg-path is a highly minimal JavaScript library designed to parse SVG path data strings into a simple array-of-arrays format. Published in 2014, with its last update 10 years ago, it remains at version 0.1.2, indicating it is no longer actively maintained. Its primary differentiator is its simplicity and small footprint, directly outputting commands as `[command, arg1, arg2, ...]`. While functional for basic SVG paths, it lacks features found in more modern and actively developed alternatives like `svg-path-parser` or `svgpath`, which offer more advanced manipulation, normalization, or broader SVG feature support. Due to its age, it primarily supports CommonJS modules and does not offer native ESM support.
npm install parse-svg-pathVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import and use the `parse` function to convert an SVG path string into an array of command arrays, including basic and complex paths.
Consider migrating to actively maintained alternatives like `svg-path-parser` or `svgpath` for better security, features, and modern JavaScript support.
Use `const parse = require('parse-svg-path');` in CommonJS environments. For ESM, you might need dynamic `import()` or rely on bundler configurations to handle CJS modules.Thoroughly test with your specific SVG path data. For complex or dynamically generated paths, a more robust parser is recommended.
Evaluate your parsing needs; if you require more than basic command extraction, use the recommended alternatives or other actively developed solutions.
This package is CommonJS. In an ESM file, try `import parse from 'parse-svg-path';` (may still require bundler configuration) or ensure your environment supports CommonJS modules.
Ensure you are importing the default export correctly: `const parse = require('parse-svg-path');` or `import parse from 'parse-svg-path';`.Verify your SVG path data against the SVG specification. If the path is valid, consider using a more modern and robust SVG path parser.
No dependency data recorded yet.