Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
engine-cache
Advanced tools
express.js inspired template-engine manager.
npm i engine-cache --save
var Engines = require('engine-cache');
engines
{Object}: Optionally pass an object of engines to initialize with.var Engines = require('engine-cache');
var engines = new Engines();
Register the given view engine callback fn
as ext
.
ext
{String}options
{Object|Function}: or callback fn
.fn
{Function}: Callback.returns
{Object} Engines
: to enable chaining.var consolidate = require('consolidate')
engines.setEngine('hbs', consolidate.handlebars)
Return the engine stored by ext
. If no ext
is passed, the entire cache is returned.
ext
{String}: The engine to get.returns
{Object}: The specified engine.var consolidate = require('consolidate')
engine.setEngine('hbs', consolidate.handlebars);
engine.getEngine('hbs');
// => {render: [function], renderFile: [function]}
Load an object of engines onto the cache
. Mostly useful for testing, but exposed as a public method.
obj
{Object}: Engines to load.returns
{Object} Engines
: to enable chaining.engines.load(require('consolidate'))
Get and set helpers for the given ext
(engine). If no ext
is passed, the entire helper cache is returned.
ext
{String}: The helper cache to get and set to.returns
{Object}: Object of helpers for the specified engine.Example:
var helpers = engines.helpers('hbs');
helpers.addHelper('foo', function() {});
helpers.getHelper('foo');
helpers.getHelper();
See helper-cache for any related issues, API details, and documentation.
Remove ext
engine from the cache, or if no value is specified the entire cache is reset.
ext
{String}: The engine to remove.Example:
engines.clear()
Jon Schlinkert
Copyright (c) 2014-2015 Jon Schlinkert
Released under the MIT license
This file was generated by verb-cli on March 31, 2015.
FAQs
express.js inspired template-engine manager.
The npm package engine-cache receives a total of 31,254 weekly downloads. As such, engine-cache popularity was classified as popular.
We found that engine-cache 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.