0.0.2 • Published 8 years ago

interpolate-url v0.0.2

Weekly downloads
57
License
MIT
Repository
github
Last release
8 years ago

interpolate-url

Build Status

Basic api to do url interpolation using colons as the delimiter.

var interpolateUrl = require('interpolate-url');

var url = interpolateUrl('http://google.com/user/:id', {id: 10});

// url => http://google.com/user/10

var url = interpolateUrl('http://google.com/:type/:id', {type: 'car', id: 10});

// url => http://google.com/car/id

Also allows partial interpolation:

var url = interpolateUrl('http://google.com/:type/:id', {id: 10});

// url => http://google.com/:type/id