path-to-template

0.0.3 • Public • Published

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

Package Sidebar

Install

npm i path-to-template

Weekly Downloads

2

Version

0.0.3

License

ISC

Last publish

Collaborators

  • josudoey