node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »



Define a path using only relative points. Most SVG drawing tools will export paths using absolute points though it can be nicer to tweak them manually when all the points are relative.

Programatic Usage

With your favourite package manager:

  • packin: packin add jkroso/rel-svg-path
  • component: component install jkroso/rel-svg-path
  • npm: npm install rel-svg-path

then in you code:

var rel = require('rel-svg-path')
rel([['M',10,20],['L',50, 40]]) // => [['m',10,20],['l',40,20]] 

Command line usage


git clone
cd rel-svg-path
make install

Then just pipe path data to it:

echo "M10 20 50 40" | rel-svg-path

Running the tests

Just run make and navigate your browser to test/index.html