Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-pate

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-pate

Simple XPath-oriented, Express-compatible Template Engine

  • 0.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

logo

About Pâté

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

Features

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

Installation

npm install node-pate

Dependencies

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

Dependencies (more info):

Basic usage

gifcast

Express example

Application:

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
  });
});

Test:

cd test-express && node bin/www

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

Namespaces

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

ns: {
    prefix: 'URI'
}

Status

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.

Limitations

  • No array iteration support
  • Ugly logo ):

Inspirations

License

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

Keywords

FAQs

Package last updated on 30 Jan 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc