Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including node-pate with all npm packages installed. Try it out:

var nodePate = require("node-pate")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

node-pate v0.0.6

Simple XPath-oriented, Express-compatible Template Engine


About Pâté

Pâté (/ˈpæteɪ/) is a simple XPath-oriented, express-compatible template engine for Node.js


  • Support for simple XPath selectors
  • Formatting via external lib
  • Compatible with Express view engine


npm install node-pate


Pâté depends on libxmljs, thus compilation is needed via node-gyp

Dependencies (more info):

Basic usage


Express example


var express = require('express');
var app = express();
var router = express.Router();

var pate = require('node-pate');
var formatter = require('./format_lib.js')

// view engine setup
app.engine('html', pate.__express);
app.set('views', path.join(__dirname, 'views'));


router.get('/test', function(req, res, next) {
  res.render('templates/test.html', {
    xml: '<data><row><bread name="Bretzel" price="42.56" /></row></data>',
    xpath: '/*/*',
    format_lib: formatter


cd test-express && node bin/www

Go to: http://localhost:3000/test


To use a namespace put it inside the options object in the form:

ns: {
    prefix: 'URI'


This software is still evolving. There are likely cases that it cannot handle, so file a feature request in github if there is something you think it should do.


  • No array iteration support
  • Ugly logo ):




Pâté is provided under the MIT free software license. See the file LICENSE for the full text.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free