base-engines
Adds support for managing template engines to your base application.
Install
Install with npm:
$ npm install --save base-engines
Usage
Register the plugin with your base application:
var Base = ;var engines = ;base;
API
.engine
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}: orsettings
settings
{Object}: Optionally pass engine options as the last argument.
Example
app; // using consolidate.jsvar engine = ;app;app; // get a registered enginevar swig = app;
.setEngine
Register engine ext
with the given render fn
and/or settings
.
Params
ext
{String}: The engine to set.
Example
app;
.getEngine
Get registered engine ext
.
Params
ext
{String}: The engine to get.
Example
app;var engine = app;
About
Related projects
- base-option: Adds a few options methods to base, like
option
,enable
anddisable
. See the readme… more | homepage - base-task: base plugin that provides a very thin wrapper around https://github.com/doowb/composer for adding task methods to… more | homepage
- base: base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… more | homepage
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Contributors
Commits | Contributor |
---|---|
6 | jonschlinkert |
4 | doowb |
Building docs
(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 tests
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
Author
Jon Schlinkert
License
Copyright © 2017, Jon Schlinkert. MIT
This file was generated by verb-generate-readme, v0.4.2, on February 21, 2017.