engine-lodash

0.8.2 • Public • Published

engine-lodash NPM version Build Status

Lo-Dash engine, consolidate.js style but with enhancements. Works with Assemble, express.js, engine-cache or any application that follows consolidate.js conventions.

Install with npm

$ npm i engine-lodash --save

Usage

var lodash = require('engine-lodash');

API

.render

Lodash string support. Render the given str and invoke the callback callback(err, str).

Params

  • str {String}
  • options {Object|Function}: or callback.
  • callback {Function}

Example

var engine = require('engine-lodash');
engine.render('<%= name %>', {name: 'Jon'}, function (err, content) {
  console.log(content); //=> 'Jon'
});

.renderSync

Render Lo-Dash or underscore templates synchronously.

Params

  • str {Object}: The string to render.
  • options {Object}: Object of options.
  • returns {String}: Rendered string.

Example

var engine = require('engine-lodash');
engine.renderSync('<%= name %>', {name: 'Halle'});
//=> 'Halle'

.renderFile

Lodash file support. Render a file at the given filepath and callback callback(err, str).

Params

  • path {String}
  • options {Object|Function}: or callback function.
  • callback {Function}

Example

var engine = require('engine-lodash');
engine.renderFile('foo/bar/baz.tmpl', {name: 'Halle'});
//=> 'Halle'

Related projects

  • engine-handlebars: Handlebars engine, consolidate.js style but with enhancements. This works with Assemble, express.js, engine-cache or any… more | homepage
  • engine-less: Consolidate-style engine for rendering .less files. | homepage
  • helper-cache: Easily register and get helper functions to be passed to any template engine or node.js… more | homepage
  • template: Render templates using any engine. Supports, layouts, pages, partials and custom template types. Use template… more | homepage
  • template-helpers: Generic JavaScript helpers that can be used with any template engine. Handlebars, Lo-Dash, Underscore, or… more | homepage

Authors

Jon Schlinkert

Brian Woodward

License

Copyright © 2014-2015 https://github.com/jonschlinkert Released under the MIT license.


This file was generated by verb-cli on August 21, 2015.

Package Sidebar

Install

npm i engine-lodash

Weekly Downloads

150

Version

0.8.2

License

MIT

Last publish

Collaborators

  • jonschlinkert
  • doowb