A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/jonschlinkert/engine-cache below:

jonschlinkert/engine-cache: express.js inspired template-engine manager.

express.js inspired template-engine manager.

Install with npm:

$ npm install --save engine-cache

Install with yarn:

var Engines = require('engine-cache');

Params

Example

var Engines = require('engine-cache');
var engines = new Engines();

Register the given view engine callback fn as ext.

Params

Example

var consolidate = require('consolidate')
engines.setEngine('hbs', consolidate.handlebars)

Add an object of engines onto engines.cache.

Params

Example

engines.setEngines(require('consolidate'))

Return the engine stored by ext. If no ext is passed, undefined is returned.

Params

Example

var consolidate = require('consolidate');
var engine = engine.setEngine('hbs', consolidate.handlebars);

var engine = engine.getEngine('hbs');
console.log(engine);
// => {render: [function], renderFile: [function]}

Get and set helpers for the given ext (engine). If no ext is passed, the entire helper cache is returned.

Example:

See helper-cache for any related issues, API details, and documentation.

Params

Example

var helpers = engines.helpers('hbs');
helpers.addHelper('bar', function() {});
helpers.getEngineHelper('bar');
helpers.getEngineHelper();

v0.19.0 ensure the string is only rendered once by passing the compiled function to the render method

v0.18.0 the .load method was renamed to .setHelpers

v0.16.0 the .clear() method was removed. A custom inspect method was added.

v0.15.0 .getEngine() no longer returns the entire cache object when ext is undefined.

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test

Jon Schlinkert

Copyright © 2017, Jon Schlinkert. Released under the MIT License.

This file was generated by verb-generate-readme, v0.5.0, on April 20, 2017.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4