Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
engine-cache
Advanced tools
express.js inspired template-engine manager.
npm i engine-cache --save
var engines = require('engine-cache');
Create a new instance of Engines
, optionally passing the default options
to use.
options
{Object}: Default options to use.Example:
var Engines = require('engine-cache')
var engines = new Engines()
Register the given view engine callback fn
as ext
.
ext
{String}fn
{Function|Object}: or options
options
{Object}var consolidate = require('consolidate')
engines.register('hbs', consolidate.handlebars)
Load an object of engines onto the cache
. Mostly useful for testing, but exposed as a public method.
obj
{Object}: Engines to load.engines.load(require('consolidate'))
Return the engine stored by ext
. If no ext
is passed, the entire cache is returned.
ext
{String}: The engine to get.var consolidate = require('consolidate')
engine.set('hbs', consolidate.handlebars)
engine.get('hbs')
// => {render: [function], renderFile: [function]}
Remove ext
from the cache, or if no value is specified the entire cache is reset.
Example:
engines.clear()
Set or get an option.
key
{String}value
{*}engines.option('a', true)
engines.option('a')
// => true
Extend the options with the given obj
.
obj
{Object}engines.extend({a: 'b'})
engines.option('a')
// => 'b'
Jon Schlinkert
Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license
This file was generated by verb-cli on August 10, 2014.
FAQs
express.js inspired template-engine manager.
The npm package engine-cache receives a total of 21,801 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.