{temple}

A URI Template processor.

Installation

npm install temple

To use Temple in the browser, download the client build and add it to your site (5k gzipped).

Usage

Server

var Temple = require('temple');
Temple.expand('{name}', {name: "Bob"});
//=> Bob

Client - 4k minified & gzipped

<script href="temple-min.js"></script>
<script>
  var tmpl = Temple.compile(
    'http://example.com{/path}'
  );
    
  tmpl({path: 'about'});
  //=> http://www.example.com/about
</script>
Fork me on GitHub