Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

engine-cache

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

engine-cache

express.js inspired template-engine manager.

  • 0.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
33K
increased by18.15%
Maintainers
1
Weekly downloads
 
Created
Source

engine-cache NPM version

express.js inspired template-engine manager.

Install

Install with npm
npm i engine-cache --save

Usage

var engines = require('engine-cache');

API

engines

  • options {Object}: Default options to use.
var engines = require('engine-cache')

.register

Register the given view engine callback fn as ext.

  • ext {String}
  • options {Object|Function}: or callback fn.
    • a {String}: This is a
    • b {String}: This is b
    • c {String}: This is c
  • fn {Function}: Callback.
  • returns {object} engines: to enable chaining.
var consolidate = require('consolidate')
engines.register('hbs', consolidate.handlebars)

.load

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

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.set('hbs', consolidate.handlebars)
engine.get('hbs')
// => {render: [function], renderFile: [function]}

.clear

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()

.option

Set or get an option.

  • key {String}
  • value {*}
  • returns {object} engines: to enable chaining.
engines.option('a', true)
engines.option('a')
// => true

.extend

Extend the options with the given obj.

  • obj {Object}
  • returns {object} engines: to enable chaining.
engines.extend({a: 'b'})
engines.option('a')
// => 'b'

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license


This file was generated by verb-cli on August 25, 2014.

Keywords

FAQs

Package last updated on 25 Aug 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc