Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
engine-cache
Advanced tools
express.js inspired template-engine manager.
Install with npm:
$ npm install --save engine-cache
var Engines = require('engine-cache');
Params
engines
{Object}: Optionally pass an object of engines to initialize with.Example
var Engines = require('engine-cache');
var engines = new Engines();
Register the given view engine callback fn
as ext
.
Params
ext
{String}options
{Object|Function}: or callback fn
.fn
{Function}: Callback.returns
{Object} Engines
: to enable chaining.Example
var consolidate = require('consolidate')
engines.setEngine('hbs', consolidate.handlebars)
Add an object of engines onto engines.cache
.
Params
obj
{Object}: Engines to load.returns
{Object} Engines
: to enable chaining.Example
engines.setEngines(require('consolidate'))
Return the engine stored by ext
. If no ext
is passed, undefined is returned.
Params
ext
{String}: The engine to get.returns
{Object}: The specified engine.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
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('bar', function() {});
helpers.getEngineHelper('bar');
helpers.getEngineHelper();
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.
You might also be interested in these projects:
This document was generated by verb-readme-generator (a verb generator), please don't edit directly. Any changes to the readme must be made in .verb.md. See Building Docs.
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue. Or visit the verb-readme-generator project to submit bug reports or pull requests for the readme layout template.
Generate readme and API documentation with verb:
$ npm install -g verb verb-readme-generator && verb
Install dev dependencies:
$ npm install -d && npm test
Jon Schlinkert
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb, v0.9.0, on June 27, 2016.
FAQs
express.js inspired template-engine manager.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.