Skip to content

Instantly share code, notes, and snippets.

@benoror
Created January 24, 2015 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benoror/08d7c4f0264b770cfd80 to your computer and use it in GitHub Desktop.
Save benoror/08d7c4f0264b770cfd80 to your computer and use it in GitHub Desktop.
node-pate-example2
var pate = require('node-pate');
var formatter = require('./format_lib.js');
var options = {
tpl: '{{ bread/@name }} price: $[[ formatMoney({{ bread/@price }}) ]] ([[ moneyToWords({{ bread/@price }}) ]])',
xml: '<data><row><bread name="Bretzel" price="42.56" /></row></data>',
xpath: '/*/*',
format_lib: formatter
};
pate.parse(options, function (err, data) {
console.log(data);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment