diff --git a/lib/consolidate.js b/lib/consolidate.js index 795c2b2..ce02e20 100644 --- a/lib/consolidate.js +++ b/lib/consolidate.js @@ -169,6 +169,28 @@ function fromStringRenderer(name) { }; } +/** + * velocity support. + */ + +exports.velocityjs = fromStringRenderer('velocityjs'); + +/** + * velocity string support. + */ + +exports.velocityjs.render = function(str, options, fn){ + return promisify(fn, function(fn) { + var engine = requires.velocityjs || (requires.velocityjs = require('velocityjs')); + try { + options.locals = options; + fn(null, engine.render(str, options).trimLeft()); + } catch (err) { + fn(err); + } + }); +}; + /** * Liquid support. */ diff --git a/package.json b/package.json index eac8362..cf8ee86 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,8 @@ "underscore": "^1.3.3", "vash": "^0.8.7", "walrus": "^0.10.1", - "whiskers": "^0.3.3" + "whiskers": "^0.3.3", + "velocityjs": "^0.8.2" }, "main": "index", "repository": {