Adds support for managing template engines to your base application.
npm install base-engines> Adds support for managing template engines to your base application.
Install with npm:
``sh`
$ npm install --save base-engines
Register the plugin with your base application:
`js`
var Base = require('base');
var engines = require('base-engines');
base.use(engines());
Register a view engine callback fn as ext. Calls .setEngine and .getEngine internally.
Params
* exts {String|Array}: String or array of file extensions.fn
* {Function|Object}: or settingssettings
* {Object}: Optionally pass engine options as the last argument.
Example
`js
app.engine('hbs', require('engine-handlebars'));
// using consolidate.js
var engine = require('consolidate');
app.engine('jade', engine.jade);
app.engine('swig', engine.swig);
// get a registered engine
var swig = app.engine('swig');
`
Register engine ext with the given render fn and/or settings.
Params
* ext {String}: The engine to set.
Example
`js`
app.setEngine('hbs', require('engine-handlebars'), {
delims: ['<%', '%>']
});
Get registered engine ext.
Params
* ext {String}: The engine to get.
Example
`js`
app.engine('hbs', require('engine-handlebars'));
var engine = app.getEngine('hbs');
* base-option: Adds a few options methods to base, like option, enable and disable. See the readme… more | option, enable and disable. See the readme for the full API."" class="text-primary hover:underline" target="_blank" rel="noopener noreferrer">homepage
* base-task: base plugin that provides a very thin wrapper around https://github.com/doowb/composer for adding task methods to… more | for adding task methods to your application."" class="text-primary hover:underline" target="_blank" rel="noopener noreferrer">homepage
* base: base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… more | set, get, del and use."" class="text-primary hover:underline" target="_blank" rel="noopener noreferrer">homepage
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
| Commits | Contributor |
| --- | --- |
| 6 | jonschlinkert |
| 4 | doowb |
_(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:
`sh`
$ 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:
`sh``
$ npm install && npm test
Jon Schlinkert
* github/jonschlinkert
* twitter/jonschlinkert
Copyright © 2017, Jon Schlinkert.
MIT
*
_This file was generated by verb-generate-readme, v0.4.2, on February 21, 2017._