svg-path-command
v2.0.0
Published
SVG path data parser library.
Downloads
4
Readme
svg-path-command
SVG path data parser library.
Install
npm i svg-path-command
Use
import { parse } from 'svg-path-command'
const pathCommand = parse('M2,8 L5,2 L8,8')
console.log(pathCommand.stringify()) // 'M2 8 L5 2 L8 8'
pathCommand.commands[0].updateParams([4, 16])
pathCommand.commands[1].updateValue({
x: 10,
y: 4,
})
console.log(pathCommand.stringify()) // 'M4 16 L10 4 L8 8'
See API Doc for detailed usage