Skip to content

Lo-Dash engine conslidate.js style, but with enhancements. Works with Assemble or express.

License

Notifications You must be signed in to change notification settings

jonschlinkert/engine-lodash

Repository files navigation

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

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

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'

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.

About

Lo-Dash engine conslidate.js style, but with enhancements. Works with Assemble or express.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published