<commit_before># engine-handlebars [![NPM version](https://badge.fury.io/js/engine-handlebars.svg)](http://badge.fury.io/js/engine-handlebars)

> Handlebars engine, consolidate.js style but with enhancements. This works with Assemble, express.js, engine-cache or any application that follows consolidate.js conventions.

## Install with [npm](npmjs.org)

```bash
npm i engine-handlebars --save
```

## Usage

```js
var handlebars = require('engine-handlebars');
```

## API
### [.compile](index.js#L42)

Handlebars string support. Compile the given `str` and register helpers and partials from settings

* `str` **{String}**    
* `settings` **{Object}**: object containing optional helpers and partials    

```js
var engine = require('engine-handlebars');
var fn = engine.compile('{{name}}', {});
```

### [.render](index.js#L72)

Handlebars string support. Render the given `str` and invoke the callback `cb(err, str)`.

* `str` **{String|function}**    
* `context` **{Object|Function}**: or callback.    
* `cb` **{Function}**: callback function.    

```js
var engine = require('engine-handlebars');
engine.render('{{name}}', {name: 'Jon'}, function (err, content) {
  console.log(content); //=> 'Jon'
});
```

### [.renderSync](index.js#L104)

Synchronously render Handlebars templates.

* `str` **{Object|Function}**: The string to render or compiled function.    
* `context` **{Object}**    
* `returns` **{String}**: Rendered string.  

```js
var engine = require('engine-handlebars');
engine.renderSync('<%= name %>', {name: 'Jon'});
//=> 'Jon'
```

### [.renderFile](index.js#L132)

Handlebars file support. Render a file at the given `path` and callback `cb(err, str)`.

* `path` **{String}**    
* `options` **{Object|Function}**: or callback function.    
* `cb` **{Function}**: callback function    

```js
var engine = require('engine-handlebars');
engine.renderSync('foo/bar/baz.tmpl', {name: 'Jon'});
//=> 'Jon'
```


## Author

**<NAME>**
 
+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) 

## License
Copyright (c) 2014-2015 <NAME>  
Released under the MIT license

***

_This file was generated by [verb](https://github.com/assemble/verb) on February 19, 2015._<commit_msg>0.7.0 docs<commit_after># engine-handlebars [![NPM version](https://badge.fury.io/js/engine-handlebars.svg)](http://badge.fury.io/js/engine-handlebars)  [![Build Status](https://travis-ci.org/jonschlinkert/engine-handlebars.svg)](https://travis-ci.org/jonschlinkert/engine-handlebars)

> Handlebars engine, consolidate.js style but with enhancements. This works with Assemble, express.js, engine-cache or any application that follows consolidate.js conventions.

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

```sh
$ npm i engine-handlebars --save
```

## Usage

```js
var handlebars = require('engine-handlebars');
```

## API

### [.compile](index.js#L42)

Handlebars string support. Compile the given `str` and register helpers and partials from settings

**Params**

* `str` **{String}**
* `settings` **{Object}**: object containing optional helpers and partials

**Example**

```js
var engine = require('engine-handlebars');
var fn = engine.compile('{{name}}', {});
```

### [.render](index.js#L72)

Handlebars string support. Render the given `str` and invoke the callback `cb(err, str)`.

**Params**

* `str` **{String|function}**
* `context` **{Object|Function}**: or callback.
* `cb` **{Function}**: callback function.

**Example**

```js
var engine = require('engine-handlebars');
engine.render('{{name}}', {name: 'Jon'}, function (err, content) {
  console.log(content); //=> 'Jon'
});
```

### [.renderSync](index.js#L104)

Synchronously render Handlebars templates.

**Params**

* `str` **{Object|Function}**: The string to render or compiled function.
* `context` **{Object}**
* `returns` **{String}**: Rendered string.

**Example**

```js
var engine = require('engine-handlebars');
engine.renderSync('<%= name %>', {name: 'Jon'});
//=> 'Jon'
```

### [.renderFile](index.js#L132)

Handlebars file support. Render a file at the given `path` and callback `cb(err, str)`.

**Params**

* `path` **{String}**
* `options` **{Object|Function}**: or callback function.
* `cb` **{Function}**: callback function

**Example**

```js
var engine = require('engine-handlebars');
engine.renderSync('foo/bar/baz.tmpl', {name: 'Jon'});
//=> 'Jon'
```

## Related projects

* [assemble](https://www.npmjs.com/package/assemble): Static site generator for Grunt.js, Yeoman and Node.js. Used by Zurb Foundation, Zurb Ink, H5BP/Effeckt,… [more](https://www.npmjs.com/package/assemble) | [homepage](http://assemble.io)
* [handlebars-helpers](https://www.npmjs.com/package/handlebars-helpers): 120+ Handlebars helpers in ~20 categories, for Assemble, YUI, Ghost or any Handlebars project. Includes… [more](https://www.npmjs.com/package/handlebars-helpers) | [homepage](https://github.com/assemble/handlebars-helpers)
* [helper-cache](https://www.npmjs.com/package/helper-cache): Easily register and get helper functions to be passed to any template engine or node.js… [more](https://www.npmjs.com/package/helper-cache) | [homepage](https://github.com/jonschlinkert/helper-cache)
* [template-helpers](https://www.npmjs.com/package/template-helpers): Generic JavaScript helpers that can be used with any template engine. Handlebars, Lo-Dash, Underscore, or… [more](https://www.npmjs.com/package/template-helpers) | [homepage](https://github.com/jonschlinkert/template-helpers)
* [templates](https://www.npmjs.com/package/templates): System for creating and managing template collections, and rendering templates with any node.js template engine.… [more](https://www.npmjs.com/package/templates) | [homepage](https://github.com/jonschlinkert/templates)

## Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/engine-handlebars/issues/new).

## Tests

Install dev dependencies:

```sh
$ npm i -d && npm test
```

## Author

**<NAME>**

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

## License

Copyright © 2014-2015 <NAME>
Released under the MIT license.

***

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on September 18, 2015._

{'fraction_non_alphanumeric': 0.1883127056243146, 'fraction_numerical': 0.008929970233432555, 'mean_word_length': 5.120805369127517, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, 'https://': 24, 'lorem ipsum': 0, 'www.': 11, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1608098', 'n_tokens_mistral': 2185, 'n_tokens_neox': 2065, 'n_words': 515}