Socket
Socket
Sign inDemoInstall

base-engines

Package Overview
Dependencies
33
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    base-engines

Adds support for managing template engines to your base application.


Version published
Maintainers
2
Install size
437 kB
Created

Readme

Source

base-engines NPM version NPM downloads Build Status

Adds support for managing template engines to your base application.

Install

Install with npm:

$ npm install --save base-engines

Usage

Register the plugin with your base application:

var Base = require('base');
var engines = require('base-engines');
base.use(engines());

API

.engine

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');

.setEngine

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: ['<%', '%>']
});

.getEngine

Get registered engine ext.

Params

  • ext {String}: The engine to get.

Example

app.engine('hbs', require('engine-handlebars'));
var engine = app.getEngine('hbs');

You might also be interested in these projects:

Contributing

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.

Building docs

Generate readme and API documentation with verb:

$ npm install -g verb verb-readme-generator && verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkert. Released under the MIT license.


This file was generated by verb, v0.9.0, on June 27, 2016.

FAQs

Last updated on 27 Jun 2016

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc