path-to-template
v0.0.3
Published
provide a template by path-to-regexp
Downloads
5
Maintainers
Readme
path-to-template
Installation
$ npm install --save path-to-template
Example
var pathT = require('path-to-template');
var tpl = pathT('/:a+/:b+');
var params = tpl.parse('/hello/world');
console.log(params);
var path = tpl.expand(params);
console.log(path);
// Output:
// { a: 'hello', b: 'world' }
// /hello/world