{"name":"engine-handlebars","description":"Handlebars engine, consolidate.js style but with enhancements. This works with Assemble, express.js, engine-cache or any application that follows consolidate.js conventions.","version":"0.8.1","homepage":"https://github.com/jonschlinkert/engine-handlebars","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"contributors":[{"name":"Brian Woodward","email":"brian.woodward@gmail.com","url":"https://github.com/doowb"},{"name":"Jon Schlinkert","email":"jon.schlinkert@sellside.com","url":"http://twitter.com/jonschlinkert"}],"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/engine-handlebars.git"},"bugs":{"url":"https://github.com/jonschlinkert/engine-handlebars/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=4.7"},"scripts":{"test":"mocha"},"dependencies":{"engine-utils":"^0.1.1","extend-shallow":"^2.0.1","handlebars":"^4.0.6"},"devDependencies":{"engine-cache":"^0.19.4","gulp":"github:gulpjs/gulp#4.0","gulp-eslint":"^3.0.1","gulp-istanbul":"^1.1.1","gulp-mocha":"^3.0.1","mocha":"^3.2.0","vinyl":"^2.0.1"},"keywords":["assemble","compile","consolidate","engine","express","handlebars","hbs","helper","partial","process","render","template","templates"],"verb":{"related":{"list":["assemble","handlebars-helpers","helper-cache","template-helpers","templates"]}},"gitHead":"ae5069b1af8f97c43822e989a179f4505453ad84","_id":"engine-handlebars@0.8.1","_shasum":"dbb9d8f8cc671bf641316d9cc41bd3a2aca001a2","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.5","_npmUser":{"name":"doowb","email":"brian.woodward@gmail.com"},"dist":{"shasum":"dbb9d8f8cc671bf641316d9cc41bd3a2aca001a2","tarball":"http://registry-npm.ywwl.com/engine-handlebars/download/engine-handlebars-0.8.1.tgz","integrity":"sha512-duqmnHX0k4lNc6nJIMaQd3CpDR5tefDTDNqiCW8C2l2IpYtVNNH1nbJKcKKyGfrkLRTpuQHTAfFWotE7PlIRFg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHALuoea+/VydN6O9vkP7XwlZoGghaSXb1K2Wa4z3JfYAiEA+Csw0FLj+M7UmESPJrD0aDJ/5o4uhBFwQ3vPx59RcjU="}],"size":4701,"noattachment":false,"key":"/engine-handlebars/-/engine-handlebars-0.8.1.tgz"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/engine-handlebars-0.8.1.tgz_1487712253800_0.6395529985893518"},"directories":{},"readme":"# engine-handlebars [![NPM version](https://img.shields.io/npm/v/engine-handlebars.svg?style=flat)](https://www.npmjs.com/package/engine-handlebars) [![NPM monthly downloads](https://img.shields.io/npm/dm/engine-handlebars.svg?style=flat)](https://npmjs.org/package/engine-handlebars) [![NPM total downloads](https://img.shields.io/npm/dt/engine-handlebars.svg?style=flat)](https://npmjs.org/package/engine-handlebars) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/engine-handlebars.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/engine-handlebars)\n\n> Handlebars engine, consolidate.js style but with enhancements. This works with Assemble, express.js, engine-cache or any application that follows consolidate.js conventions.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save engine-handlebars\n```\n\n## Heads up!\n\nThere were major [breaking changes in v1.0!](#release-history).\n\n## Usage\n\n```js\nconst handlebars = require('handlebars');\nconst engine = require('engine-handlebars')(handlebars);\nconsole.log(engine);\n```\n\nThe `engine` object that is returned has the following properties:\n\n* `name` - the name of the engine: `handlebars`, used for engine detection in other libraries.\n* `instance` - your instance of handlebars\n* `compile` - async compile method\n* `compileSync` - sync compile method\n* `render` -  async render method\n* `renderSync` - sync render method\n\n## API\n\n### [.compile](index.js#L49)\n\nCompile `file.contents` with `handlebars.compile()`. Adds a compiled `.fn()` property to the given `file`.\n\n**Params**\n\n* `file` **{Object}**: File object with `contents` string or buffer.\n* `options` **{Object}**: Options with partials and helpers.\n* `returns` **{Promise}**\n\n**Example**\n\n```js\nengine.compile({ contents: 'Jon {{ name }}' })\n  .then(file => {\n    console.log(typeof file.fn) // 'function'\n  });\n```\n\n### [.render](index.js#L70)\n\nRender `file.contents` with the function returned from `.compile()`.\n\n**Params**\n\n* `file` **{Object}**: File object with `contents` string or buffer.\n* `locals` **{Object}**: Locals to use as contents to render the string.\n* `options` **{Object}**: Options with partials and helpers.\n* `returns` **{Promise}**\n\n**Example**\n\n```js\nengine.render({ contents: 'Jon {{ name }}' }, { name: 'Schlinkert' })\n  .then(file => {\n    console.log(file.contents.toString()) // 'Jon Schlinkert'\n  });\n```\n\n### [.compileSync](index.js#L116)\n\nCompile `file.contents` with `handlebars.compile()`. Adds a compiled `.fn()` property to the given `file`.\n\n**Params**\n\n* `file` **{Object}**: File object with `contents` string or buffer.\n* `options` **{Object}**: Options with partials and helpers.\n* `returns` **{Object}**: Returns the file object.\n\n**Example**\n\n```js\nlet file = engine.compileSync({ contents: 'Jon {{ name }}' });\nconsole.log(typeof file.fn) // 'function'\n```\n\n### [.renderSync](index.js#L146)\n\nRender `file.contents` with the function returned from `.compile()`.\n\n**Params**\n\n* `file` **{Object}**: File object with `contents` string or buffer.\n* `locals` **{Object}**: Locals to use as contents to render the string.\n* `options` **{Object}**: Options with partials and helpers.\n* `returns` **{Object}**: Returns the file object.\n\n**Example**\n\n```js\nlet file = engine.renderSync({ contents: 'Jon {{ name }}' }, { name: 'Schlinkert' });\nconsole.log(file.contents.toString()) // 'Jon Schlinkert'\n```\n\n## Release History\n\n### v1.0.0\n\n* The main export is now a function that takes an instance of handlebars.\n* `renderFile` and `__express` have been removed.\n* `.compile` and `.render` now return a promise.\n* `.compileSync` and `.renderSync` may be used for sync operations.\n* All methods now expect a `file` object with a `.contents` property (string or buffer).\n\n### v0.8.0\n\n* `renderFile` now expects a [vinyl](https://github.com/gulpjs/vinyl) file.\n* The old renderFile method is now exposed on `engine.__express`\n\n### v0.7.0\n\n* updated to handlebars 0.4.0\n\n## About\n\n<details>\n<summary><strong>Contributing</strong></summary>\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n</details>\n\n<details>\n<summary><strong>Running Tests</strong></summary>\n\nRunning 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:\n\n```sh\n$ npm install && npm test\n```\n\n</details>\n\n<details>\n<summary><strong>Building docs</strong></summary>\n\n_(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.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n</details>\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble \"Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit\")\n* [handlebars-helpers](https://www.npmjs.com/package/handlebars-helpers): More than 130 Handlebars helpers in ~20 categories. Helpers can be used with Assemble, Generate… [more](https://github.com/helpers/handlebars-helpers) | [homepage](https://github.com/helpers/handlebars-helpers \"More than 130 Handlebars helpers in ~20 categories. Helpers can be used with Assemble, Generate, Verb, Ghost, gulp-handlebars, grunt-handlebars, consolidate, or any node.js/Handlebars project.\")\n* [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://github.com/jonschlinkert/template-helpers) | [homepage](https://github.com/jonschlinkert/template-helpers \"Generic JavaScript helpers that can be used with any template engine. Handlebars, Lo-Dash, Underscore, or any engine that supports helper functions.\")\n* [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://github.com/jonschlinkert/templates) | [homepage](https://github.com/jonschlinkert/templates \"System for creating and managing template collections, and rendering templates with any node.js template engine. Can be used as the basis for creating a static site generator or blog framework.\")\n\n### Contributors\n\n| **Commits** | **Contributor** |  \n| --- | --- |  \n| 32 | [jonschlinkert](https://github.com/jonschlinkert) |  \n| 18 | [doowb](https://github.com/doowb) |  \n\n### Author\n\n**Jon Schlinkert**\n\n* [GitHub Profile](https://github.com/jonschlinkert)\n* [Twitter Profile](https://twitter.com/jonschlinkert)\n* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)\n\n### License\n\nCopyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on November 11, 2018._","publish_time":1487712255630,"_cnpm_publish_time":1487712255630,"dist-tags":{"latest":"1.1.0"}}