engine-lodash

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

MIT 20 个版本
安装
npm install engine-lodash
yarn add engine-lodash
pnpm add engine-lodash
bun add engine-lodash
README

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'
  • 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.

版本列表
0.8.2 2015-08-21
0.8.0 2015-08-21
0.7.1 2015-06-15
0.7.0 2015-06-01
0.6.3 2015-04-21
0.6.2 2015-04-01
0.6.1 2015-04-01
0.5.0 2015-02-03
0.4.3 2015-02-01
0.4.2 2015-02-01
0.4.0 2014-11-11
0.3.5 2014-11-07
0.3.3 2014-10-28
0.3.2 2014-10-24
0.3.1 2014-10-24
0.3.0 2014-10-24
0.2.0 2014-09-01
0.1.2 2014-08-25
0.1.1 2014-08-25
0.1.0 2014-08-09