{"_id":"template-bind-helpers","_rev":"106671","name":"template-bind-helpers","description":"Bind the current instance of a Templates-based application to an object of helpers, allowing them to be passed to a different render method.","dist-tags":{"latest":"0.2.0"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T10:38:42.000Z","created":"2015-04-19T05:40:04.033Z","0.2.0":"2015-12-11T17:00:08.929Z","0.1.2":"2015-04-19T06:12:22.729Z","0.1.1":"2015-04-19T06:07:21.575Z","0.1.0":"2015-04-19T05:40:04.033Z"},"users":{},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/template-bind-helpers.git"},"versions":{"0.2.0":{"name":"template-bind-helpers","description":"Bind the current instance of a Templates-based application to an object of helpers, allowing them to be passed to a different render method.","version":"0.2.0","homepage":"https://github.com/jonschlinkert/template-bind-helpers","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/template-bind-helpers.git"},"bugs":{"url":"https://github.com/jonschlinkert/template-bind-helpers/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"isobject":"^2.0.0"},"devDependencies":{"engine-base":"^0.1.2","lodash":"^3.10.1","mocha":"*","should":"*","template-helpers":"^0.3.4","templates":"^0.6.3"},"keywords":["assemble","engines","generate","helper","helpers","template","templates","verb"],"verb":{"plugins":["gulp-format-md"],"related":{"list":["helper-cache","engine-cache","async-helpers","template-helpers"]},"reflinks":["template","assemble","verb","generate"]},"gitHead":"6b86e793e71773ecc06bf8bf7480013fc8870f07","_id":"template-bind-helpers@0.2.0","_shasum":"be5e5f8053ddf5a031c46df48ab02a76b9380ba3","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"be5e5f8053ddf5a031c46df48ab02a76b9380ba3","size":2729,"noattachment":false,"key":"/template-bind-helpers/-/template-bind-helpers-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/template-bind-helpers/download/template-bind-helpers-0.2.0.tgz"},"directories":{},"publish_time":1449853208929,"_cnpm_publish_time":1449853208929},"0.1.2":{"name":"template-bind-helpers","description":"Utility for applications based on Template for exposing the current instance of the application as `this` in helpers.","version":"0.1.2","homepage":"https://github.com/jonschlinkert/template-bind-helpers","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/template-bind-helpers.git"},"bugs":{"url":"https://github.com/jonschlinkert/template-bind-helpers/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/template-bind-helpers/blob/master/LICENSE"},"files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"devDependencies":{"engine-lodash":"^0.6.2","lodash":"^3.7.0","mocha":"*","should":"*","template":"^0.12.6","template-helpers":"^0.3.2"},"keywords":["assemble","engines","generate","helper","helpers","template","templates","verb"],"gitHead":"be8d6579e3f722cb77c60cbab054cca102993c7f","_id":"template-bind-helpers@0.1.2","_shasum":"dcb7376db2681c43dd74bc3a73f522400e1b727e","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"dcb7376db2681c43dd74bc3a73f522400e1b727e","size":2565,"noattachment":false,"key":"/template-bind-helpers/-/template-bind-helpers-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/template-bind-helpers/download/template-bind-helpers-0.1.2.tgz"},"directories":{},"publish_time":1429423942729,"_cnpm_publish_time":1429423942729,"_hasShrinkwrap":false},"0.1.1":{"name":"template-bind-helpers","description":"Utility for applications based on Template for exposing the current instance of the application as `this` in helpers.","version":"0.1.1","homepage":"https://github.com/jonschlinkert/template-bind-helpers","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/template-bind-helpers.git"},"bugs":{"url":"https://github.com/jonschlinkert/template-bind-helpers/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/template-bind-helpers/blob/master/LICENSE"},"files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"devDependencies":{"engine-lodash":"^0.6.2","lodash":"^3.7.0","mocha":"*","should":"*","template":"^0.12.6","template-helpers":"^0.3.2"},"keywords":["assemble","engines","generate","helper","helpers","template","templates","verb"],"gitHead":"f1c18e716043d4eb37f76177aeeb34c47bad10f1","_id":"template-bind-helpers@0.1.1","_shasum":"244e7f77315fdcdc03298ea144e46d720fc3dd86","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"244e7f77315fdcdc03298ea144e46d720fc3dd86","size":2578,"noattachment":false,"key":"/template-bind-helpers/-/template-bind-helpers-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/template-bind-helpers/download/template-bind-helpers-0.1.1.tgz"},"directories":{},"publish_time":1429423641575,"_cnpm_publish_time":1429423641575,"_hasShrinkwrap":false},"0.1.0":{"name":"template-bind-helpers","description":"Utility for Template for exposing the context as `this` in helpers.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/template-bind-helpers","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/template-bind-helpers.git"},"bugs":{"url":"https://github.com/jonschlinkert/template-bind-helpers/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/template-bind-helpers/blob/master/LICENSE"},"files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{},"devDependencies":{"mocha":"*","should":"*"},"keywords":[],"_id":"template-bind-helpers@0.1.0","_shasum":"06bd2438ce4069f58caf002f3572f521af7c570c","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"06bd2438ce4069f58caf002f3572f521af7c570c","size":2373,"noattachment":false,"key":"/template-bind-helpers/-/template-bind-helpers-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/template-bind-helpers/download/template-bind-helpers-0.1.0.tgz"},"directories":{},"publish_time":1429422004033,"_cnpm_publish_time":1429422004033,"_hasShrinkwrap":false}},"readme":"# template-bind-helpers [![NPM version](https://img.shields.io/npm/v/template-bind-helpers.svg)](https://www.npmjs.com/package/template-bind-helpers) [![Build Status](https://img.shields.io/travis/jonschlinkert/template-bind-helpers.svg)](https://travis-ci.org/jonschlinkert/template-bind-helpers)\n\n> Bind the current instance of a Templates-based application to an object of helpers, allowing them to be passed to a different render method.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/)\n\n```sh\n$ npm i template-bind-helpers --save\n```\n\n## Usage\n\n### bindHelpers\n\nBind helper functions to `app` so that, when the helper is called, the `this` keyword is set to the provided instance of `app`.\n\n**Params**\n\n* `app` **{Object}**: Instance of any [Templates-based][templates] application, such as [verb](https://github.com/verbose/verb), [assemble](http://assemble.io) or [generate](https://github.com/jonschlinkert/generate)\n* `view` **{Object}**: The view being compiled or rendered\n* `locals` **{Object}**: Context object with helpers to bind. This is usually the `options` object.\n* `isAsync` **{Boolean}**\n* `returns` **{Object}**\n\n**Example**\n\n```js\nvar bindHelpers = require('{%= name %}');\nvar str = '<%= replace(\"foo\", \"bar\") %>';\nopts = bindHelpers(this.app, opts, true);\n\n// pass opts to a render method as context\napp.render(str, opts, function(err, result) {\n  console.log(result);\n});\n```\n\n## Related projects\n\n* [async-helpers](https://www.npmjs.com/package/async-helpers): Use async helpers in templates with engines that typically only handle sync helpers. Handlebars and… [more](https://www.npmjs.com/package/async-helpers) | [homepage](https://github.com/doowb/async-helpers)\n* [engine-cache](https://www.npmjs.com/package/engine-cache): express.js inspired template-engine manager. | [homepage](https://github.com/jonschlinkert/engine-cache)\n* [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)\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://www.npmjs.com/package/template-helpers) | [homepage](https://github.com/jonschlinkert/template-helpers)\n\n## Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm i -d && npm test\n```\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/template-bind-helpers/issues/new).\n\n## Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)\n\n## License\n\nCopyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert)\nReleased under the MIT license.\n\n***\n\n_This file was generated by [verb](https://github.com/verbose/verb) on December 11, 2015._","_attachments":{},"homepage":"https://github.com/jonschlinkert/template-bind-helpers","bugs":{"url":"https://github.com/jonschlinkert/template-bind-helpers/issues"},"license":"MIT"}