# base-engines

> Adds support for managing template engines to your base application.

Latest version **0.2.1** (published 2017-02-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install base-engines
pnpm add base-engines
yarn add base-engines
bun add base-engines
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2017-02-21 |
| First published | 2016-06-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Jon Schlinkert |
| Maintainers | doowb, jonschlinkert |
| Keywords | api, app, application, base, base-plugin, baseplugin, building-blocks, create, engines, framework, plugin, plugins, tool, toolkit, tools |

## Links

- npm: https://www.npmjs.com/package/base-engines
- Repository: https://github.com/node-base/base-engines
- Issues: https://github.com/node-base/base-engines/issues
- npm.io page: https://npm.io/package/base-engines

## Dependencies (5)

- [debug](https://npm.io/package/debug.md) ^2.2.0
- [lazy-cache](https://npm.io/package/lazy-cache.md) ^2.0.1
- [engine-cache](https://npm.io/package/engine-cache.md) ^0.19.0
- [is-valid-app](https://npm.io/package/is-valid-app.md) ^0.1.2
- [define-property](https://npm.io/package/define-property.md) ^0.2.5

## Alternatives

- [@sveltejs/kit](https://npm.io/package/@sveltejs/kit.md) — 2.2M weekly downloads
- [@atlaskit/theme](https://npm.io/package/@atlaskit/theme.md) — 402.0K weekly downloads
- [@tangle-network/brand](https://npm.io/package/@tangle-network/brand.md) — 10.0K weekly downloads
- [seneca](https://npm.io/package/seneca.md) — 7.4K weekly downloads
- [@bsb/base](https://npm.io/package/@bsb/base.md) — 7.2K weekly downloads

## Recent versions

- 0.2.1 (latest) — 2017-02-21
- 0.2.0 — 2016-06-27
- 0.1.1 — 2016-06-07
- 0.1.0 — 2016-06-01

## README

# base-engines [![NPM version](https://img.shields.io/npm/v/base-engines.svg?style=flat)](https://www.npmjs.com/package/base-engines) [![NPM monthly downloads](https://img.shields.io/npm/dm/base-engines.svg?style=flat)](https://npmjs.org/package/base-engines)  [![NPM total downloads](https://img.shields.io/npm/dt/base-engines.svg?style=flat)](https://npmjs.org/package/base-engines) [![Linux Build Status](https://img.shields.io/travis/node-base/base-engines.svg?style=flat&label=Travis)](https://travis-ci.org/node-base/base-engines)

> Adds support for managing template engines to your base application.

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm install --save base-engines
```

## Usage

Register the plugin with your [base](https://github.com/node-base/base) application:

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

## API

### [.engine](index.js#L45)

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**

```js
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](index.js#L74)

Register engine `ext` with the given render `fn` and/or `settings`.

**Params**

* `ext` **{String}**: The engine to set.

**Example**

```js
app.setEngine('hbs', require('engine-handlebars'), {
  delims: ['<%', '%>']
});
```

### [.getEngine](index.js#L97)

Get registered engine `ext`.

**Params**

* `ext` **{String}**: The engine to get.

**Example**

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

## About

### Related projects

* [base-option](https://www.npmjs.com/package/base-option): Adds a few options methods to base, like `option`, `enable` and `disable`. See the readme… [more](https://github.com/node-base/base-option) | [homepage](https://github.com/node-base/base-option "Adds a few options methods to base, like `option`, `enable` and `disable`. See the readme for the full API.")
* [base-task](https://www.npmjs.com/package/base-task): base plugin that provides a very thin wrapper around [https://github.com/doowb/composer](https://github.com/doowb/composer) for adding task methods to… [more](https://github.com/node-base/base-task) | [homepage](https://github.com/node-base/base-task "base plugin that provides a very thin wrapper around <https://github.com/doowb/composer> for adding task methods to your application.")
* [base](https://www.npmjs.com/package/base): base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… [more](https://github.com/node-base/base) | [homepage](https://github.com/node-base/base "base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting with a handful of common methods, like `set`, `get`, `del` and `use`.")

### Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

### Contributors

| **Commits** | **Contributor** | 
| --- | --- |
| 6 | [jonschlinkert](https://github.com/jonschlinkert) |
| 4 | [doowb](https://github.com/doowb) |

### Building docs

_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_

To generate the readme, run the following command:

```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```

### Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

```sh
$ npm install && npm test
```

### Author

**Jon Schlinkert**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)

### License

Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
MIT

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 21, 2017._

---
_Source: https://npm.io/package/base-engines · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
