{"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":"1.0.0","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","main":"index.js","engines":{"node":">=8"},"scripts":{"test":"mocha"},"devDependencies":{"gulp-format-md":"^1.0.0","handlebars":"^4.0.12","mocha":"^5.2.0"},"keywords":["assemble","compile","consolidate","engine","express","handlebars","hbs","helper","partial","process","render","template","templates"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["assemble","handlebars-helpers","template-helpers","templates"]},"lint":{"reflinks":true}},"gitHead":"19266068ef2b07e14609c5b05f29b60555b0119f","_id":"engine-handlebars@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.10.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"dist":{"integrity":"sha512-vd8bin+kSYRU+p1KhjLwDVEtBxrH/5LHdtfrlpxwNy6W4mJsBg+eDBDnI+pLjQMc8Ua/NczW/Mf69qlvbyCnvw==","shasum":"a1026d3ce0508eff719ee4e298ac12c219dcee57","tarball":"http://registry-npm.ywwl.com/engine-handlebars/download/engine-handlebars-1.0.0.tgz","fileCount":4,"unpackedSize":15466,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5/c2CRA9TVsSAnZWagAAaRwP/3CKfqM4v4Mndd0N9iK3\nw7cnuUFdFkeMYRuCelFt/k8EtVmcMyn060MC33wVRWRm4ncCg30KzeeVWAs3\nxO8DG6ZR/0Z/t+HQoS6afjsud9u6pRTJSiMUP01OsLbNOeu+ekNaLWmEdUOo\n9act/hcmmDrlGdf0XhUy23/9KDeiYUy8wdr6aOdB8KFAW6/Afhg7Nm5vTLcD\nx1VikfhP5iJS5CyxKfGG8zarSeBv0Zgx5Rp0OCqd6IFwKDSZ+rcSGsCmKhID\nEzUME8c6QfCWBWbJqyJ1/N0B9UVjqJ5yU6UZ/q2UeE030UNqmaY09WPQRt8h\nSgdC2QCYks1me03EtLyR82Qn1Qa0WzHtkuVrK3IbTiVCKQiR/RwEi/nN+iYY\n1fuPH01akAvdzCnlMphngBi3hIQJ6ozayo1UXNCzlSlWfXwU2Elook8GHeoY\nJTI6fZkWWiOmUtfNllfjq9pM7t02aHew97cVmNxbyDY5nbzrdAjgrJxXVeCp\nEaFddEkKRCe/QHRD1OWFIeMLhxEhx1QPB77dkW6JfFO9lkZ1pzYfj4alEQ+b\n/feZFlqGSPrKCYVrnOW0CrvdJ8RTYB3JkZW4wqBOvk4JCsnyl4lin4f+FYZX\nEHgmxnHreG1uW1my1wgZ3G+NV7N3vOmuUZfEuFK+bvJdCSXOCHHtq0EUA6sx\nB+Wk\r\n=Z5Nh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJXDQs/ZWoQttVVFzuGI3ol9Fg9A9gVBZ11aoEqWZDwAIhAK0Euc+vb4IpPjxYoMMfcDtUTIidWGEZtDHKl28Tv7dM"}],"size":4593,"noattachment":false,"key":"/engine-handlebars/-/engine-handlebars-1.0.0.tgz"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/engine-handlebars_1.0.0_1541928757633_0.5078067167658289"},"_hasShrinkwrap":false,"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":1541928757801,"_cnpm_publish_time":1541928757801,"dist-tags":{"latest":"1.1.0"}}