
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
base-engines
Advanced tools
Adds support for managing template engines to your base application.
Adds support for managing template engines to your base application.
Install with npm:
$ npm install --save base-engines
Register the plugin with your base application:
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 settings
settings
{Object}: Optionally pass engine options as the last argument.Example
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
app.setEngine('hbs', require('engine-handlebars'), {
delims: ['<%', '%>']
});
Get registered engine ext
.
Params
ext
{String}: The engine to get.Example
app.engine('hbs', require('engine-handlebars'));
var engine = app.getEngine('hbs');
option
, enable
and disable
. See the readme… more | homepagePull 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:
$ 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. MIT
This file was generated by verb-generate-readme, v0.4.2, on February 21, 2017.
FAQs
Adds support for managing template engines to your base application.
The npm package base-engines receives a total of 21,052 weekly downloads. As such, base-engines popularity was classified as popular.
We found that base-engines demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.