diff --git a/lib/consolidate.js b/lib/consolidate.js index f077a35..9dcf032 100644 --- a/lib/consolidate.js +++ b/lib/consolidate.js @@ -184,6 +184,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 16117b2..1603e72 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ "vash": "^0.12.2", "walrus": "^0.10.1", "whiskers": "^0.4.0" + "velocityjs": "^0.8.2" }, "keywords": [ "engine",