{"id":13906847,"url":"https://github.com/jonschlinkert/template-helpers","last_synced_at":"2025-04-13T18:40:55.014Z","repository":{"id":65395202,"uuid":"31507035","full_name":"jonschlinkert/template-helpers","owner":"jonschlinkert","description":"Generic JavaScript helpers that can be used with any template engine. Handlebars, Lo-Dash, Underscore, or any engine that supports helper functions.","archived":false,"fork":false,"pushed_at":"2018-11-25T01:11:14.000Z","size":213,"stargazers_count":78,"open_issues_count":0,"forks_count":6,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-06T16:11:34.461Z","etag":null,"topics":["engine","handlebare","handlebars-helpers","helper","helpers","html","javascript","jonschlinkert","lodash","node","nodejs","render","template","template-engine"],"latest_commit_sha":null,"homepage":"http://jonschlinkert.github.io/template-helpers","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonschlinkert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-01T19:03:28.000Z","updated_at":"2025-03-26T21:39:31.000Z","dependencies_parsed_at":"2023-01-21T21:02:34.404Z","dependency_job_id":null,"html_url":"https://github.com/jonschlinkert/template-helpers","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Ftemplate-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Ftemplate-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Ftemplate-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Ftemplate-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/template-helpers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248764365,"owners_count":21158071,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["engine","handlebare","handlebars-helpers","helper","helpers","html","javascript","jonschlinkert","lodash","node","nodejs","render","template","template-engine"],"created_at":"2024-08-06T23:01:43.523Z","updated_at":"2025-04-13T18:40:54.987Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# template-helpers [![NPM version](https://img.shields.io/npm/v/template-helpers.svg?style=flat)](https://www.npmjs.com/package/template-helpers) [![NPM monthly downloads](https://img.shields.io/npm/dm/template-helpers.svg?style=flat)](https://npmjs.org/package/template-helpers) [![NPM total downloads](https://img.shields.io/npm/dt/template-helpers.svg?style=flat)](https://npmjs.org/package/template-helpers) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/template-helpers.svg?style=flat\u0026label=Travis)](https://travis-ci.org/jonschlinkert/template-helpers)\n\n\u003e Generic JavaScript helpers that can be used with any template engine. Handlebars, Lo-Dash, Underscore, or any engine that supports helper functions.\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](#install)\n- [Usage](#usage)\n  * [Template-engine agnostic](#template-engine-agnostic)\n  * [Namespacing](#namespacing)\n- [Helpers](#helpers)\n  * [array](#array)\n  * [code](#code)\n  * [collection](#collection)\n  * [conditional](#conditional)\n  * [fs](#fs)\n  * [html](#html)\n  * [index](#index)\n  * [math](#math)\n  * [object](#object)\n  * [path](#path)\n  * [string](#string)\n- [Coverage](#coverage)\n- [About](#about)\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save template-helpers\n```\n\n## Usage\n\nTo get all helpers:\n\n```js\nconst helpers = require('template-helpers')();\nconsole.log(helpers);\n```\n\n**Get a specific helper category**\n\n```js\n// get only the math helpers\nconst helpers = require('template-helpers')('math');\n```\n\n**Get multiple helper categories**\n\n```js\n// get only the math helpers\nconst helpers = require('template-helpers')(['math', 'string']);\n```\n\n### Template-engine agnostic\n\n**Lo-Dash Example**\n\n```js\nconst helpers = require('template-helpers')('array');\n\n// pass helpers on `imports`\nconst imports = { imports: helpers };\n\n// compile a template\nconst fn = _.template('\u003c%= first(foo) %\u003e', imports);\n\n// render\nfn({ foo: ['a', 'b', 'c'] });\n//=\u003e 'a'\n```\n\n### Namespacing\n\nHandlebars and Lo-Dash both allow **dot notation** to be used for referencing helpers. I'd be happy to add examples for other engines if someone wants to do a PR.\n\n**Example**\n\n```js\n\u003c%= path.dirname(\"a/b/c/d.js\") %\u003e\n```\n\nThis can be used as a way of working around potential naming conflicts.\n\n## Helpers\n\n_(The following **API Table of Contents** is generated by [verb](https://github.com/verbose/verb). See the [verbfile.js](verbfile.js) for more details.)_\n\n## Categories\n\nCurrently **101 helpers** in **10 categories**:\n\n* **[array](#array)** ([code](lib/helpers/array.js) | [unit tests](test/array.js))\n* **[code](#code)** ([code](lib/helpers/code.js) | [unit tests](test/code.js))\n* **[collection](#collection)** ([code](lib/helpers/collection.js) | [unit tests](test/collection.js))\n* **[conditional](#conditional)** ([code](lib/helpers/conditional.js) | [unit tests](test/conditional.js))\n* **[fs](#fs)** ([code](lib/helpers/fs.js) | [unit tests](test/fs.js))\n* **[html](#html)** ([code](lib/helpers/html.js) | [unit tests](test/html.js))\n* **[math](#math)** ([code](lib/helpers/math.js) | [unit tests](test/math.js))\n* **[object](#object)** ([code](lib/helpers/object.js) | [unit tests](test/object.js))\n* **[path](#path)** ([code](lib/helpers/path.js) | [unit tests](test/path.js))\n* **[string](#string)** ([code](lib/helpers/string.js) | [unit tests](test/string.js))\n\n## All helpers\n\n### [array helpers](#array)\n\nVisit the: [code](lib/helpers/array.js) | [unit tests](test/array.js) | [issues](https://github.com/jonschlinkert/template-helpers/issues?utf8=%E2%9C%93\u0026q=is%3Aissue+is%3Aopen+array+helpers))\n\n* **[isArray](#isArray)** ([code](lib/helpers/array.js#L21) | [unit tests](test/array.js#L18))\n* **[arrayify](#arrayify)** ([code](lib/helpers/array.js#L42) | [unit tests](test/array.js#L25))\n* **[first](#first)** ([code](lib/helpers/array.js#L58) | [unit tests](test/array.js#L32))\n* **[last](#last)** ([code](lib/helpers/array.js#L79) | [unit tests](test/array.js#L48))\n* **[before](#before)** ([code](lib/helpers/array.js#L102) | [unit tests](test/array.js#L61))\n* **[after](#after)** ([code](lib/helpers/array.js#L121) | [unit tests](test/array.js#L71))\n* **[each](#each)** ([code](lib/helpers/array.js#L147) | [unit tests](test/array.js#L98))\n* **[map](#map)** ([code](lib/helpers/array.js#L188) | [unit tests](test/array.js#L122))\n* **[join](#join)** ([code](lib/helpers/array.js#L218) | [unit tests](test/array.js#L82))\n* **[sort](#sort)** ([code](lib/helpers/array.js#L241) | [unit tests](test/array.js#L137))\n* **[length](#length)** ([code](lib/helpers/array.js#L272) | [unit tests](test/array.js#L162))\n* **[compact](#compact)** ([code](lib/helpers/array.js#L289) | [unit tests](test/array.js#L178))\n* **[difference](#difference)** ([code](lib/helpers/array.js#L307) | [unit tests](test/array.js#L189))\n* **[unique](#unique)** ([code](lib/helpers/array.js#L344) | [unit tests](test/array.js#L205))\n* **[union](#union)** ([code](lib/helpers/array.js#L373) | [unit tests](test/array.js#L215))\n* **[shuffle](#shuffle)** ([code](lib/helpers/array.js#L389) | [no tests])\n\n### [code helpers](#code)\n\nVisit the: [code](lib/helpers/code.js) | [unit tests](test/code.js) | [issues](https://github.com/jonschlinkert/template-helpers/issues?utf8=%E2%9C%93\u0026q=is%3Aissue+is%3Aopen+code+helpers))\n\n* **[embed](#embed)** ([code](lib/helpers/code.js#L23) | [unit tests](test/code.js#L33))\n* **[jsfiddle](#jsfiddle)** ([code](lib/helpers/code.js#L45) | [unit tests](test/code.js#L24))\n\n### [collection helpers](#collection)\n\nVisit the: [code](lib/helpers/collection.js) | [unit tests](test/collection.js) | [issues](https://github.com/jonschlinkert/template-helpers/issues?utf8=%E2%9C%93\u0026q=is%3Aissue+is%3Aopen+collection+helpers))\n\n* **[any](#any)** ([code](lib/helpers/collection.js#L17) | [unit tests](test/collection.js#L17))\n* **[filter](#filter)** ([code](lib/helpers/collection.js#L32) | [unit tests](test/collection.js#L34))\n\n### [conditional helpers](#conditional)\n\nVisit the: [code](lib/helpers/conditional.js) | [unit tests](test/conditional.js) | [issues](https://github.com/jonschlinkert/template-helpers/issues?utf8=%E2%9C%93\u0026q=is%3Aissue+is%3Aopen+conditional+helpers))\n\n* **[and](#and)** ([code](lib/helpers/conditional.js#L13) | [no tests])\n* **[compare](#compare)** ([code](lib/helpers/conditional.js#L30) | [unit tests](test/conditional.js#L35))\n* **[find](#find)** ([code](lib/helpers/conditional.js#L72) | [no tests])\n* **[every](#every)** ([code](lib/helpers/conditional.js#L83) | [no tests])\n* **[gt](#gt)** ([code](lib/helpers/conditional.js#L98) | [no tests])\n* **[gte](#gte)** ([code](lib/helpers/conditional.js#L110) | [no tests])\n* **[_if](#_if)** ([code](lib/helpers/conditional.js#L122) | [no tests])\n* **[is](#is)** ([code](lib/helpers/conditional.js#L142) | [unit tests](test/conditional.js#L47))\n* **[eq](#eq)** ([code](lib/helpers/conditional.js#L157) | [no tests])\n* **[isnt](#isnt)** ([code](lib/helpers/conditional.js#L169) | [unit tests](test/conditional.js#L59))\n* **[notEq](#notEq)** ([code](lib/helpers/conditional.js#L183) | [no tests])\n* **[lt](#lt)** ([code](lib/helpers/conditional.js#L195) | [no tests])\n* **[lte](#lte)** ([code](lib/helpers/conditional.js#L207) | [no tests])\n* **[or](#or)** ([code](lib/helpers/conditional.js#L219) | [no tests])\n* **[some](#some)** ([code](lib/helpers/conditional.js#L230) | [no tests])\n\n### [fs helpers](#fs)\n\nVisit the: [code](lib/helpers/fs.js) | [unit tests](test/fs.js) | [issues](https://github.com/jonschlinkert/template-helpers/issues?utf8=%E2%9C%93\u0026q=is%3Aissue+is%3Aopen+fs+helpers))\n\n* **[exists](#exists)** ([code](lib/helpers/fs.js#L16) | [unit tests](test/fs.js#L17))\n* **[read](#read)** ([code](lib/helpers/fs.js#L29) | [unit tests](test/fs.js#L23))\n\n### [html helpers](#html)\n\nVisit the: [code](lib/helpers/html.js) | [unit tests](test/html.js) | [issues](https://github.com/jonschlinkert/template-helpers/issues?utf8=%E2%9C%93\u0026q=is%3Aissue+is%3Aopen+html+helpers))\n\n* **[escapeHtml](#escapeHtml)** ([code](lib/helpers/html.js#L18) | [unit tests](test/html.js#L17))\n* **[sanitize](#sanitize)** ([code](lib/helpers/html.js#L46) | [unit tests](test/html.js#L27))\n\n### [math helpers](#math)\n\nVisit the: [code](lib/helpers/math.js) | [unit tests](test/math.js) | [issues](https://github.com/jonschlinkert/template-helpers/issues?utf8=%E2%9C%93\u0026q=is%3Aissue+is%3Aopen+math+helpers))\n\n* **[add](#add)** ([code](lib/helpers/math.js#L17) | [unit tests](test/math.js#L17))\n* **[subtract](#subtract)** ([code](lib/helpers/math.js#L31) | [unit tests](test/math.js#L23))\n* **[divide](#divide)** ([code](lib/helpers/math.js#L46) | [unit tests](test/math.js#L29))\n* **[multiply](#multiply)** ([code](lib/helpers/math.js#L61) | [unit tests](test/math.js#L35))\n* **[floor](#floor)** ([code](lib/helpers/math.js#L76) | [unit tests](test/math.js#L41))\n* **[ceil](#ceil)** ([code](lib/helpers/math.js#L91) | [unit tests](test/math.js#L47))\n* **[round](#round)** ([code](lib/helpers/math.js#L109) | [unit tests](test/math.js#L53))\n* **[sum](#sum)** ([code](lib/helpers/math.js#L123) | [unit tests](test/math.js#L60))\n\n### [object helpers](#object)\n\nVisit the: [code](lib/helpers/object.js) | [unit tests](test/object.js) | [issues](https://github.com/jonschlinkert/template-helpers/issues?utf8=%E2%9C%93\u0026q=is%3Aissue+is%3Aopen+object+helpers))\n\n* **[fallback](#fallback)** ([code](lib/helpers/object.js#L22) | [unit tests](test/object.js#L18))\n* **[stringify](#stringify)** ([code](lib/helpers/object.js#L36) | [unit tests](test/object.js#L26))\n* **[parse](#parse)** ([code](lib/helpers/object.js#L50) | [unit tests](test/object.js#L33))\n* **[get](#get)** ([code](lib/helpers/object.js#L65) | [no tests])\n* **[keys](#keys)** ([code](lib/helpers/object.js#L79) | [unit tests](test/object.js#L64))\n* **[isObject](#isObject)** ([code](lib/helpers/object.js#L97) | [unit tests](test/object.js#L40))\n* **[isPlainObject](#isPlainObject)** ([code](lib/helpers/object.js#L117) | [unit tests](test/object.js#L48))\n* **[hasOwn](#hasOwn)** ([code](lib/helpers/object.js#L129) | [unit tests](test/object.js#L57))\n* **[omit](#omit)** ([code](lib/helpers/object.js#L144) | [unit tests](test/object.js#L98))\n* **[forIn](#forIn)** ([code](lib/helpers/object.js#L163) | [unit tests](test/object.js#L70))\n* **[forOwn](#forOwn)** ([code](lib/helpers/object.js#L188) | [unit tests](test/object.js#L84))\n* **[extend](#extend)** ([code](lib/helpers/object.js#L205) | [unit tests](test/object.js#L105))\n* **[merge](#merge)** ([code](lib/helpers/object.js#L241) | [unit tests](test/object.js#L132))\n\n### [path helpers](#path)\n\nVisit the: [code](lib/helpers/path.js) | [unit tests](test/path.js) | [issues](https://github.com/jonschlinkert/template-helpers/issues?utf8=%E2%9C%93\u0026q=is%3Aissue+is%3Aopen+path+helpers))\n\n* **[dirname](#dirname)** ([code](lib/helpers/path.js#L19) | [unit tests](test/path.js#L17))\n* **[basename](#basename)** ([code](lib/helpers/path.js#L34) | [unit tests](test/path.js#L23))\n* **[filename](#filename)** ([code](lib/helpers/path.js#L49) | [unit tests](test/path.js#L29))\n* **[stem](#stem)** ([code](lib/helpers/path.js#L65) | [no tests])\n* **[extname](#extname)** ([code](lib/helpers/path.js#L80) | [unit tests](test/path.js#L35))\n* **[ext](#ext)** ([code](lib/helpers/path.js#L80) | [unit tests](test/path.js#L35))\n* **[resolve](#resolve)** ([code](lib/helpers/path.js#L110) | [unit tests](test/path.js#L47))\n* **[relative](#relative)** ([code](lib/helpers/path.js#L126) | [unit tests](test/path.js#L53))\n* **[segments](#segments)** ([code](lib/helpers/path.js#L162) | [unit tests](test/path.js#L107))\n* **[join](#join)** ([code](lib/helpers/path.js#L183) | [unit tests](test/path.js#L100))\n* **[isAbsolute](#isAbsolute)** ([code](lib/helpers/path.js#L215) | [unit tests](test/path.js#L81))\n* **[isRelative](#isRelative)** ([code](lib/helpers/path.js#L247) | [unit tests](test/path.js#L62))\n\n### [string helpers](#string)\n\nVisit the: [code](lib/helpers/string.js) | [unit tests](test/string.js) | [issues](https://github.com/jonschlinkert/template-helpers/issues?utf8=%E2%9C%93\u0026q=is%3Aissue+is%3Aopen+string+helpers))\n\n* **[camelcase](#camelcase)** ([code](lib/helpers/string.js#L24) | [unit tests](test/string.js#L98))\n* **[centerAlign](#centerAlign)** ([code](lib/helpers/string.js#L46) | [no tests])\n* **[chop](#chop)** ([code](lib/helpers/string.js#L69) | [unit tests](test/string.js#L50))\n* **[count](#count)** ([code](lib/helpers/string.js#L88) | [unit tests](test/string.js#L277))\n* **[dotcase](#dotcase)** ([code](lib/helpers/string.js#L107) | [unit tests](test/string.js#L162))\n* **[ellipsis](#ellipsis)** ([code](lib/helpers/string.js#L128) | [unit tests](test/string.js#L368))\n* **[isString](#isString)** ([code](lib/helpers/string.js#L147) | [no tests])\n* **[lower](#lower)** ([code](lib/helpers/string.js#L161) | [unit tests](test/string.js#L16))\n* **[lowercase](#lowercase)** ([code](lib/helpers/string.js#L161) | [unit tests](test/string.js#L16))\n* **[pascalcase](#pascalcase)** ([code](lib/helpers/string.js#L177) | [unit tests](test/string.js#L119))\n* **[snakecase](#snakecase)** ([code](lib/helpers/string.js#L196) | [unit tests](test/string.js#L141))\n* **[split](#split)** ([code](lib/helpers/string.js#L214) | [no tests])\n* **[strip](#strip)** ([code](lib/helpers/string.js#L230) | [unit tests](test/string.js#L72))\n* **[stripIndent](#stripIndent)** ([code](lib/helpers/string.js#L248) | [unit tests](test/string.js#L86))\n* **[trim](#trim)** ([code](lib/helpers/string.js#L275) | [unit tests](test/string.js#L36))\n* **[dashcase](#dashcase)** ([code](lib/helpers/string.js#L291) | [unit tests](test/string.js#L183))\n* **[pathcase](#pathcase)** ([code](lib/helpers/string.js#L309) | [unit tests](test/string.js#L204))\n* **[sentencecase](#sentencecase)** ([code](lib/helpers/string.js#L327) | [unit tests](test/string.js#L225))\n* **[hyphenate](#hyphenate)** ([code](lib/helpers/string.js#L345) | [unit tests](test/string.js#L239))\n* **[slugify](#slugify)** ([code](lib/helpers/string.js#L363) | [unit tests](test/string.js#L257))\n* **[reverse](#reverse)** ([code](lib/helpers/string.js#L377) | [unit tests](test/string.js#L291))\n* **[rightAlign](#rightAlign)** ([code](lib/helpers/string.js#L394) | [no tests])\n* **[replace](#replace)** ([code](lib/helpers/string.js#L412) | [unit tests](test/string.js#L330))\n* **[titleize](#titleize)** ([code](lib/helpers/string.js#Lundefined) | [no tests])\n* **[titlecase](#titlecase)** ([code](lib/helpers/string.js#L433) | [unit tests](test/string.js#L348))\n* **[truncate](#truncate)** ([code](lib/helpers/string.js#L451) | [unit tests](test/string.js#L358))\n* **[upper](#upper)** ([code](lib/helpers/string.js#L467) | [unit tests](test/string.js#L26))\n* **[uppercase](#uppercase)** ([code](lib/helpers/string.js#L467) | [unit tests](test/string.js#L26))\n* **[wordwrap](#wordwrap)** ([code](lib/helpers/string.js#L484) | [unit tests](test/string.js#L300))\n\n### array\n\n#### [isArray](lib/helpers/array.js#L21)\n\nReturns true if `value` is an array.\n\n**Params**\n\n* `value` **{any}**: The value to test.\n* `returns` **{Boolean}**\n\n**Example**\n\n```js\n\u003c%= isArray('a, b, c') %\u003e\n//=\u003e 'false'\n\n\u003c%= isArray(['a, b, c']) %\u003e\n//=\u003e 'true'\n```\n\n#### [arrayify](lib/helpers/array.js#L42)\n\nCast `val` to an array.\n\n**Params**\n\n* `val` **{any}**: The value to arrayify.\n* `returns` **{Array}**: An array.\n* `returns` **{Array}**\n\n**Example**\n\n```js\n\u003c%= arrayify('a') %\u003e\n//=\u003e '[\"a\"]'\n\n\u003c%= arrayify({a: 'b'}) %\u003e\n//=\u003e '[{a: \"b\"}]'\n\n\u003c%= arrayify(['a']) %\u003e\n//=\u003e '[\"a\"]'\n```\n\n#### [first](lib/helpers/array.js#L58)\n\nReturns the first item, or first `n` items of an array.\n\n**Params**\n\n* `array` **{Array}**\n* `n` **{Number}**: Number of items to return, starting at `0`.\n* `returns` **{Array}**\n\n**Example**\n\n```js\n\u003c%= first(['a', 'b', 'c', 'd', 'e'], 2) %\u003e\n//=\u003e '[\"a\", \"b\"]'\n```\n\n#### [last](lib/helpers/array.js#L79)\n\nReturns the last item, or last `n` items of an array.\n\n**Params**\n\n* `array` **{Array}**\n* `n` **{Number}**: Number of items to return, starting with the last item.\n* `returns` **{Array}**\n\n**Example**\n\n```js\n\u003c%= last(['a', 'b', 'c', 'd', 'e'], 2) %\u003e\n//=\u003e '[\"d\", \"e\"]'\n```\n\n#### [before](lib/helpers/array.js#L102)\n\nReturns all of the items in an array up to the specified number Opposite of `\u003c%= after() %`.\n\n**Params**\n\n* `array` **{Array}**\n* `n` **{Number}**\n* `returns` **{Array}**: Array excluding items after the given number.\n\n**Example**\n\n```js\n\u003c%= before(['a', 'b', 'c'], 2) %\u003e\n//=\u003e '[\"a\", \"b\"]'\n```\n\n#### [after](lib/helpers/array.js#L121)\n\nReturns all of the items in an arry after the specified index. Opposite of `\u003c%= before() %`.\n\n**Params**\n\n* `array` **{Array}**: Collection\n* `n` **{Number}**: Starting index (number of items to exclude)\n* `returns` **{Array}**: Array exluding `n` items.\n\n**Example**\n\n```js\n\u003c%= after(['a', 'b', 'c'], 1) %\u003e\n//=\u003e '[\"c\"]'\n```\n\n#### [each](lib/helpers/array.js#L147)\n\nCalling `fn` on each element of the given `array` with the given `context`.\n\nAssuming that `double` has been registered as a helper:\n\n**Params**\n\n* `array` **{Array}**\n* `fn` **{String}**: The function to call on each element in the given array.\n* `returns` **{String}**\n\n**Examples**\n\n```js\nfunction double(str) {\n  return str + str;\n}\n```\n\n```js\n\u003c%= each(['a', 'b', 'c'], double, ctx) %\u003e\n//=\u003e '[\"aa\", \"bb\", \"cc\"]'\n```\n\n#### [map](lib/helpers/array.js#L188)\n\nReturns a new array, created by calling `function` on each element of the given `array`.\n\nAssuming that `double` has been registered as a helper:\n\n**Params**\n\n* `array` **{Array}**\n* `fn` **{String}**: The function to call on each element in the given array.\n* `returns` **{String}**\n\n**Examples**\n\n```js\nfunction double(str) {\n  return str + str;\n}\n```\n\n```js\n\u003c%= map(['a', 'b', 'c'], double) %\u003e\n//=\u003e '[\"aa\", \"bb\", \"cc\"]'\n```\n\n#### [join](lib/helpers/array.js#L218)\n\nJoin all elements of array into a string, optionally using a given separator.\n\n**Params**\n\n* `array` **{Array}**\n* `sep` **{String}**: The separator to use.\n* `returns` **{String}**\n\n**Example**\n\n```js\n\u003c%= join(['a', 'b', 'c']) %\u003e\n//=\u003e 'a, b, c'\n\n\u003c%= join(['a', 'b', 'c'], '-') %\u003e\n//=\u003e 'a-b-c'\n```\n\n#### [sort](lib/helpers/array.js#L241)\n\nSort the given `array`. If an array of objects is passed, you may optionally pass a `key` to sort on as the second argument. You may alternatively pass a sorting function as the second argument.\n\n**Params**\n\n* `array` **{Array}**: the array to sort.\n* `key` **{String|Function}**: The object key to sort by, or sorting function.\n\n**Example**\n\n```js\n\u003c%= sort([\"b\", \"a\", \"c\"]) %\u003e\n//=\u003e 'a,b,c'\n\n\u003c%= sort([{a: \"zzz\"}, {a: \"aaa\"}], \"a\") %\u003e\n//=\u003e '[{\"a\":\"aaa\"},{\"a\":\"zzz\"}]'\n```\n\n#### [length](lib/helpers/array.js#L272)\n\nReturns the length of the given array.\n\n**Params**\n\n* `array` **{Array}**\n* `returns` **{Number}**: The length of the array.\n\n**Example**\n\n```js\n\u003c%= length(['a', 'b', 'c']) %\u003e\n//=\u003e 3\n```\n\n#### [compact](lib/helpers/array.js#L289)\n\nReturns an array with all falsey values removed.\n\n**Params**\n\n* `arr` **{Array}**\n* `returns` **{Array}**\n\n**Example**\n\n```js\n\u003c%= compact([null, a, undefined, 0, false, b, c, '']) %\u003e\n//=\u003e '[\"a\", \"b\", \"c\"]'\n```\n\n#### [difference](lib/helpers/array.js#L307)\n\nReturn the difference between the first array and additional arrays.\n\n**Params**\n\n* `array` **{Array}**: The array to compare againts.\n* `arrays` **{Array}**: One or more additional arrays.\n* `returns` **{Array}**\n\n**Example**\n\n```js\n\u003c%= difference([\"a\", \"c\"], [\"a\", \"b\"]) %\u003e\n//=\u003e '[\"c\"]'\n```\n\n#### [unique](lib/helpers/array.js#L344)\n\nReturn an array, free of duplicate values.\n\n**Params**\n\n* `array` **{Array}**: The array to uniquify\n* `returns` **{Array}**: Duplicate-free array\n\n**Example**\n\n```js\n\u003c%= unique(['a', 'b', 'c', 'c']) %\n=\u003e '[\"a\", \"b\", \"c\"]'\n```\n\n#### [union](lib/helpers/array.js#L373)\n\nReturns an array of unique values using strict equality for comparisons.\n\n**Params**\n\n* `arr` **{Array}**\n* `returns` **{Array}**\n\n**Example**\n\n```js\n\u003c%= union([\"a\"], [\"b\"], [\"c\"]) %\u003e\n//=\u003e '[\"a\", \"b\", \"c\"]'\n```\n\n#### [shuffle](lib/helpers/array.js#L389)\n\nShuffle the items in an array.\n\n**Params**\n\n* `arr` **{Array}**\n* `returns` **{Array}**\n\n**Example**\n\n```js\n\u003c%= shuffle([\"a\", \"b\", \"c\"]) %\u003e\n//=\u003e [\"c\", \"a\", \"b\"]\n```\n\n### code\n\n#### [embed](lib/helpers/code.js#L23)\n\nEmbed code from an external file as preformatted text.\n\n**Params**\n\n* `fp` **{String}**: filepath to the file to embed.\n* `language` **{String}**: Optionally specify the language to use for syntax highlighting.\n* `returns` **{String}**\n\n**Example**\n\n```js\n\u003c%= embed('path/to/file.js') %\u003e\n\n// specify the language to use\n\u003c%= embed('path/to/file.hbs', 'html') %\u003e\n```\n\n#### [jsfiddle](lib/helpers/code.js#L45)\n\nGenerate the HTML for a jsFiddle link with the given `params`\n\n**Params**\n\n* `params` **{Object}**\n* `returns` **{String}**\n\n**Example**\n\n```js\n\u003c%= jsfiddle({id: '0dfk10ks', {tabs: true}}) %\u003e\n```\n\n### collection\n\n#### [any](lib/helpers/collection.js#L17)\n\nReturns `true` if `value` exists in the given string, array\nor object. See [any](https://github.com/jonschlinkert/any) for documentation.\n\n**Params**\n\n* `value` **{any}**\n* `target` **{any}**\n* `options` **{Object}**\n\n#### [filter](lib/helpers/collection.js#L32)\n\nFilter the given array or object to contain only the matching values.\n\n**Params**\n\n* `arr` **{Array}**\n* `returns` **{Array}**\n\n**Example**\n\n```js\n\u003c%= filter(['foo', 'bar', 'baz']) %\u003e\n//=\u003e '[\"a\", \"b\", \"c\"]'\n```\n\n### conditional\n\n#### [and](lib/helpers/conditional.js#L13)\n\nReturns true when both `valueA` and `valueB` are truthy.\n\n**Params**\n\n* `valueA` **{any}**\n* `valueB` **{any}**\n* `returns` **{Boolean}**\n\n#### [compare](lib/helpers/conditional.js#L30)\n\nRender a block when a comparison of the first and third arguments returns true.\n\n**Params**\n\n* `valueA` **{String}**\n* `operator` **{String}**: The operator to use for the comparison (must be a quoted string).\n* `valueB` **{String}**\n* `returns` **{Boolean}**\n\n**Example**\n\n```js\n\u003c%= compare(\"foo\", \"!==\", \"bar\") %\u003e\n```\n\n#### [find](lib/helpers/conditional.js#L72)\n\nReturns the first truthy value.\n\n**Params**\n\n* `...values` **{...args}**\n* `returns` **{any}**\n\n#### [every](lib/helpers/conditional.js#L83)\n\nReturns true when all provided values are truthy.\n\n**Params**\n\n* `...values` **{...any}**\n* `returns` **{Boolean}**\n\n#### [gt](lib/helpers/conditional.js#L98)\n\nReturns true when `valueA` is greater than `valueB`.\n\n**Params**\n\n* `valueA` **{String}**\n* `valueB` **{String}**\n* `returns` **{Boolean}**\n\n#### [gte](lib/helpers/conditional.js#L110)\n\nReturns true when `valueA` is greater than or equal to `valueB`.\n\n**Params**\n\n* `valueA` **{String}**\n* `valueB` **{String}**\n* `returns` **{Boolean}**\n\n#### [_if](lib/helpers/conditional.js#L122)\n\nReturn true if `key` is an own, enumerable property\nof the given `obj`.\n\n**Params**\n\n* `object` **{Object}**\n* `key` **{String}**\n* `returns` **{Boolean}**\n\n#### [is](lib/helpers/conditional.js#L142)\n\nReturns true when `valueA` equals `valueB`.\n\n**Params**\n\n* `valueA` **{String}**\n* `valueB` **{String}**\n* `strict` **{String}**\n* `returns` **{Boolean}**\n\n#### [eq](lib/helpers/conditional.js#L157)\n\nAlias for [is](#is).\n\n**Params**\n\n* `valueA` **{String}**\n* `valueB` **{String}**\n* `strict` **{String}**\n* `returns` **{Boolean}**\n\n#### [isnt](lib/helpers/conditional.js#L169)\n\nReturns true when `valueA` does not equal `valueB`.\n\n**Params**\n\n* `valueA` **{String}**\n* `valueB` **{String}**\n* `returns` **{Boolean}**\n\n#### [notEq](lib/helpers/conditional.js#L183)\n\nAlias for [isnt](#isnt).\n\n**Params**\n\n* `valueA` **{String}**\n* `valueB` **{String}**\n* `returns` **{Boolean}**\n\n#### [lt](lib/helpers/conditional.js#L195)\n\nReturns true when `valueA` is less than `valueB`.\n\n**Params**\n\n* `valueA` **{String}**\n* `valueB` **{String}**\n* `returns` **{Boolean}**\n\n#### [lte](lib/helpers/conditional.js#L207)\n\nReturns true when `valueA` is less than or equal to `valueB`.\n\n**Params**\n\n* `valueA` **{String}**\n* `valueB` **{String}**\n* `returns` **{Boolean}**\n\n#### [or](lib/helpers/conditional.js#L219)\n\nReturns `valueA` if thruthy, otherwise `valueB`.\n\n**Params**\n\n* `valueA` **{any}**\n* `valueB` **{any}**\n* `returns` **{any}**\n\n#### [some](lib/helpers/conditional.js#L230)\n\nReturns true when at least one value is truthy.\n\n**Params**\n\n* `...values` **{...any}**\n* `returns` **{Boolean}**\n\n### fs\n\n#### [exists](lib/helpers/fs.js#L16)\n\nReturn true if a file exists\n\n**Params**\n\n* `filepath` **{String}**: Path of the file to check.\n* `returns` **{Boolean}**: True if the file exists\n\n**Example**\n\n```js\n\u003c%= exists(\"foo.js\") %\u003e\n```\n\n#### [read](lib/helpers/fs.js#L29)\n\nRead a file from the file system and inject its content\n\n**Params**\n\n* `filepath` **{String}**: Path of the file to read.\n* `returns` **{String}**: Contents of the given file.\n\n**Example**\n\n```js\n\u003c%= read(\"foo.js\") %\u003e\n```\n\n### html\n\n#### [escapeHtml](lib/helpers/html.js#L18)\n\nEscape HTML characters in a string.\n\n**Params**\n\n* `str` **{String}**: String of HTML with characters to escape.\n* `returns` **{String}**\n\n**Example**\n\n```js\n\u003c%= escapeHtml(\"\u003cspan\u003efoo\u003c/span\u003e\") %\u003e\n//=\u003e \u0026lt;span\u0026gt;foo\u0026lt;\u0026#x2F;span\u0026gt;\n```\n\n#### [sanitize](lib/helpers/html.js#L46)\n\nStrip HTML tags from a string, so that only the text nodes are preserved.\n\n**Params**\n\n* `str` **{String}**: The string of HTML to sanitize.\n* `returns` **{String}**\n\n**Example**\n\n```js\n\u003c%= sanitize(\"\u003cspan\u003efoo\u003c/span\u003e\") %\u003e\n//=\u003e 'foo'\n```\n\n### math\n\n#### [add](lib/helpers/math.js#L17)\n\nReturn the product of `a` plus `b`.\n\n**Params**\n\n* `a` **{Number}**\n* `b` **{Number}**\n\n**Example**\n\n```js\n\u003c%= add(1, 2) %\u003e\n//=\u003e '3'\n```\n\n#### [subtract](lib/helpers/math.js#L31)\n\nSubtract `b` from `a`.\n\n**Params**\n\n* `a` **{Number}**\n* `b` **{Number}**\n\n**Example**\n\n```js\n\u003c%= subtract(5, 2) %\u003e\n//=\u003e '3'\n```\n\n#### [divide](lib/helpers/math.js#L46)\n\nDivide `a` (the numerator) by `b` (the divisor).\n\n**Params**\n\n* `a` **{Number}**: the numerator.\n* `b` **{Number}**: the divisor.\n* `returns` **{Number}**: The quotient of `a` divided by `b`.\n\n**Example**\n\n```js\n\u003c%= divide(10, 2) %\u003e\n//=\u003e '5'\n```\n\n#### [multiply](lib/helpers/math.js#L61)\n\nMultiply `a` by `b`.\n\n**Params**\n\n* `a` **{Number}**\n* `b` **{Number}**\n* `returns` **{Number}**: The product of `a` times `b`.\n\n**Example**\n\n```js\n\u003c%= divide(10, 2) %\u003e\n//=\u003e '5'\n```\n\n#### [floor](lib/helpers/math.js#L76)\n\nReturns the largest integer less than or equal to the given `number`.\n\n**Params**\n\n* `number` **{Number}**\n* `returns` **{Number}**\n\n**Example**\n\n```js\n\u003c%= floor(10.6) %\u003e\n//=\u003e '10'\n```\n\n#### [ceil](lib/helpers/math.js#L91)\n\nReturns the smallest integer greater than or equal to the given `number`.\n\n**Params**\n\n* `number` **{Number}**\n* `returns` **{Number}**\n\n**Example**\n\n```js\n\u003c%= ceil(10.1) %\u003e\n//=\u003e '11'\n```\n\n#### [round](lib/helpers/math.js#L109)\n\nReturns the value of the given `number` rounded to the nearest integer.\n\n**Params**\n\n* `number` **{Number}**\n* `returns` **{Number}**\n\n**Example**\n\n```js\n\u003c%= round(10.1) %\u003e\n//=\u003e '10'\n\n\u003c%= round(10.5) %\u003e\n//=\u003e '11'\n```\n\n#### [sum](lib/helpers/math.js#L123)\n\nReturns the sum of all numbers in the given array.\n\n**Params**\n\n* `number` **{Number}**\n* `returns` **{Number}**\n\n**Example**\n\n```js\n\u003c%= sum([1, 2, 3, 4, 5]) %\u003e\n//=\u003e '15'\n```\n\n### object\n\n#### [fallback](lib/helpers/object.js#L22)\n\nSpecify a fallback value to use when the desired value is undefined. Note that undefined variables that are _not object properties_ with throw an error.\n\n**Params**\n\n* `a` **{any}**: The desired value.\n* `b` **{any}**: The fallback (\"default\") value\n* `returns` **{any}**: Either `a` or `b`\n\n**Example**\n\n```js\n// when `title` is undefined, use the generic `site.title`\n\u003c%= fallback(page.title, site.title) %\u003e\n```\n\n#### [stringify](lib/helpers/object.js#L36)\n\nStringify an object using `JSON.stringify()`.\n\n**Params**\n\n* `object` **{Object}**\n* `returns` **{String}**\n\n**Example**\n\n```js\n\u003c%= stringify({a: \"a\"}) %\u003e\n//=\u003e '{\"a\":\"a\"}'\n```\n\n#### [parse](lib/helpers/object.js#L50)\n\nParse a string into an object using `JSON.parse()`.\n\n**Params**\n\n* `str` **{String}**: The string to parse.\n* `returns` **{Object}**: The parsed object.\n\n**Example**\n\n```js\n\u003c%= parse('{\"foo\":\"bar\"}')[\"foo\"] %\u003e\n//=\u003e 'bar'\n```\n\n#### [get](lib/helpers/object.js#L65)\n\nUse property paths (`a.b.c`) get a nested value from an object.\n\n**Params**\n\n* `object` **{Object}**\n* `path` **{String}**: Dot notation for the property to get.\n* `returns` **{String}**\n\n**Example**\n\n```js\n\u003c%= get({a: {b: 'c'}}, 'a.b') %\u003e\n//=\u003e 'c'\n```\n\n#### [keys](lib/helpers/object.js#L79)\n\nReturns an array of keys from the given `object`.\n\n**Params**\n\n* `object` **{Object}**\n* `returns` **{Array}**: Keys from `object`\n\n**Example**\n\n```js\n\u003c%= keys({a: 'b', c: 'd'}) %\u003e\n//=\u003e '[\"a\", \"c\"]'\n```\n\n#### [isObject](lib/helpers/object.js#L97)\n\nReturn true if the given `value` is an object, and not `null` or an array.\n\n**Params**\n\n* `value` **{Object}**: The value to check.\n* `returns` **{Boolean}**\n\n**Example**\n\n```js\n\u003c%= isObject(['a', 'b', 'c']) %\u003e\n//=\u003e 'false'\n\n\u003c%= isObject({a: 'b'}) %\u003e\n//=\u003e 'true'\n```\n\n#### [isPlainObject](lib/helpers/object.js#L117)\n\nReturn true if the given `value` is a plain object.\n\n**Params**\n\n* `value` **{Object}**: The value to check.\n* `returns` **{Boolean}**\n\n**Example**\n\n```js\n\u003c%= isPlainObject(['a', 'b', 'c']) %\u003e\n//=\u003e 'false'\n\n\u003c%= isPlainObject({a: 'b'}) %\u003e\n//=\u003e 'true'\n\n\u003c%= isPlainObject(/foo/g) %\u003e\n//=\u003e 'false'\n```\n\n#### [hasOwn](lib/helpers/object.js#L129)\n\nReturn true if `key` is an own, enumerable property\nof the given `obj`.\n\n**Params**\n\n* `object` **{Object}**\n* `key` **{String}**\n* `returns` **{Boolean}**\n\n#### [omit](lib/helpers/object.js#L144)\n\nReturn a copy of `object` exclusing the given `keys`.\n\n**Params**\n\n* `object` **{Object}**: Object with keys to omit.\n* `keys` **{String}**: Keys to omit.\n* `returns` **{Boolean}**\n\n**Example**\n\n```js\n\u003c%= omit({a: 'a', b: 'b', c: 'c'}, ['a', 'c']) %\u003e\n//=\u003e '{b: \"b\"}'\n```\n\n#### [forIn](lib/helpers/object.js#L163)\n\nIterate over the own and inherited enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`.\n\n**Params**\n\n* `object` **{Object}**: Object with keys to omit.\n* `keys` **{String}**: Keys to omit.\n* `returns` **{Boolean}**\n\n**Example**\n\n```js\nconst context = { values: { a: 'b', c: 'd' } };\nconst str = '\u003c% forIn(values, function(val, key) { %\u003e\u003c%= val %\u003e\u003c% }) %\u003e';\nconst fn = _.template(str, { imports: helpers });\nassert.equal(fn(context), 'bd');\n```\n\n#### [forOwn](lib/helpers/object.js#L188)\n\nIterate over the own enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`\n\n**Params**\n\n* `object` **{Object}**: Object with keys to omit.\n* `keys` **{String}**: Keys to omit.\n* `returns` **{Boolean}**\n\n**Example**\n\n```js\nconst context = { values: { a: 'b', c: 'd' } };\nconst str = '\u003c% forOwn(values, function(val, key) { %\u003e\u003c%= key %\u003e\u003c% }) %\u003e';\nconst fn = _.template(str, { imports: helpers });\nconsole.log(fn(context)) //=\u003e 'ac'\n```\n\n#### [extend](lib/helpers/object.js#L205)\n\nExtend `o` with properties of other `objects`.\n\n**Params**\n\n* `o` **{Object}**: The target object. Pass an empty object to shallow clone.\n* `objects` **{Object}**\n* `returns` **{Object}**\n\n#### [merge](lib/helpers/object.js#L241)\n\nRecursively combine the properties of `o` with the\nproperties of other `objects`.\n\n**Params**\n\n* `o` **{Object}**: The target object. Pass an empty object to shallow clone.\n* `objects` **{Object}**\n* `returns` **{Object}**\n\n### path\n\n#### [dirname](lib/helpers/path.js#L19)\n\nReturn the dirname for the given `filepath`. Uses the node.js [path](https://nodejs.org/api/path.html) module.\n\n**Params**\n\n* `filepath` **{String}**\n* `returns` **{String}**: Returns the directory part of the file path.\n\n**Example**\n\n```js\n\u003c%= dirname(\"a/b/c/d\") %\u003e\n//=\u003e 'a/b/c'\n```\n\n#### [basename](lib/helpers/path.js#L34)\n\nReturn the basename for the given `filepath`. Uses the node.js [path](https://nodejs.org/api/path.html) module.\n\n**Params**\n\n* `filepath` **{String}**\n* `returns` **{String}**: Returns the basename part of the file path.\n\n**Example**\n\n```js\n\u003c%= basename(\"a/b/c/d.js\") %\u003e\n//=\u003e 'd.js'\n```\n\n#### [filename](lib/helpers/path.js#L49)\n\nReturns the filename for the given `filepath`, excluding extension. Aliased as `stem`.\n\n**Params**\n\n* `filepath` **{String}**\n* `returns` **{String}**: Returns the file name part of the file path.\n\n**Example**\n\n```js\n\u003c%= filename(\"a/b/c/d.js\") %\u003e\n//=\u003e 'd'\n```\n\n#### [stem](lib/helpers/path.js#L65)\n\nAlias for [filename](#filename).\n\n**Params**\n\n* `filepath` **{String}**\n* `returns` **{String}**: Returns the file name part of the file path.\n\n**Example**\n\n```js\n\u003c%= stem(\"a/b/c/d.js\") %\u003e\n//=\u003e 'd'\n```\n\n#### [extname](lib/helpers/path.js#L80)\n\nReturn the file extension for the given `filepath`. Uses the node.js [path](https://nodejs.org/api/path.html) module.\n\n**Params**\n\n* `filepath` **{String}**\n* `returns` **{String}**: Returns a file extension\n\n**Example**\n\n```js\n\u003c%= extname(\"foo.js\") %\u003e\n//=\u003e '.js'\n```\n\n#### [ext](lib/helpers/path.js#L95)\n\nReturn the file extension for the given `filepath`, excluding the `.`.\n\n**Params**\n\n* `filepath` **{String}**\n* `returns` **{String}**: Returns a file extension without dot.\n\n**Example**\n\n```js\n\u003c%= ext(\"foo.js\") %\u003e\n//=\u003e 'js'\n```\n\n#### [resolve](lib/helpers/path.js#L110)\n\nResolves the given paths to an absolute path. Uses the node.js [path](https://nodejs.org/api/path.html) module.\n\n**Params**\n\n* `filepath` **{String}**\n* `returns` **{String}**: Returns a resolve\n\n**Example**\n\n```js\n\u003c%= resolve('/foo/bar', './baz') %\u003e\n//=\u003e '/foo/bar/baz'\n```\n\n#### [relative](lib/helpers/path.js#L126)\n\nGet the relative path from file `a` to file `b`. Typically `a` and `b` would be variables passed on the context. Uses the node.js [path](https://nodejs.org/api/path.html) module.\n\n**Params**\n\n* `a` **{String}**: The \"from\" file path.\n* `b` **{String}**: The \"to\" file path.\n* `returns` **{String}**: Returns a relative path.\n\n**Example**\n\n```js\n\u003c%= relative(a, b) %\u003e\n```\n\n#### [segments](lib/helpers/path.js#L162)\n\nGet specific (joined) segments of a file path by passing a range of array indices.\n\n**Params**\n\n* `filepath` **{String}**: The file path to split into segments.\n* `returns` **{String}**: Returns a single, joined file path.\n\n**Example**\n\n```js\n\u003c%= segments(\"a/b/c/d\", \"2\", \"3\") %\u003e\n//=\u003e 'c/d'\n\n\u003c%= segments(\"a/b/c/d\", \"1\", \"3\") %\u003e\n//=\u003e 'b/c/d'\n\n\u003c%= segments(\"a/b/c/d\", \"1\", \"2\") %\u003e\n//=\u003e 'b/c'\n```\n\n#### [join](lib/helpers/path.js#L183)\n\nJoin all arguments together and normalize the resulting `filepath`. Uses the node.js [path](https://nodejs.org/api/path.html) module.\n\n**Note**: there is also a `join()` array helper, dot notation\ncan be used with helpers to differentiate. Example: `\u003c%= path.join() %\u003e`.\n\n**Params**\n\n* `filepaths` **{String}**: List of file paths.\n* `returns` **{String}**: Returns a single, joined file path.\n\n**Example**\n\n```js\n\u003c%= join(\"a\", \"b\") %\u003e\n//=\u003e 'a/b'\n```\n\n#### [isAbsolute](lib/helpers/path.js#L215)\n\nReturns true if a file path is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. Uses the node.js [path](https://nodejs.org/api/path.html) module.\n\n**Params**\n\n* `filepath` **{String}**\n* `returns` **{String}**: Returns a resolve\n\n**Example**\n\n```js\n// posix\n\u003c%= isAbsolute('/foo/bar') %\u003e\n//=\u003e 'true'\n\u003c%= isAbsolute('qux/') %\u003e\n//=\u003e 'false'\n\u003c%= isAbsolute('.') %\u003e\n//=\u003e 'false'\n\n// Windows\n\u003c%= isAbsolute('//server') %\u003e\n//=\u003e 'true'\n\u003c%= isAbsolute('C:/foo/..') %\u003e\n//=\u003e 'true'\n\u003c%= isAbsolute('bar\\\\baz') %\u003e\n//=\u003e 'false'\n\u003c%= isAbsolute('.') %\u003e\n//=\u003e 'false'\n```\n\n#### [isRelative](lib/helpers/path.js#L247)\n\nReturns true if a file path is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. Uses the node.js [path](https://nodejs.org/api/path.html) module.\n\n**Params**\n\n* `filepath` **{String}**\n* `returns` **{String}**: Returns a resolve\n\n**Example**\n\n```js\n// posix\n\u003c%= isRelative('/foo/bar') %\u003e\n//=\u003e 'false'\n\u003c%= isRelative('qux/') %\u003e\n//=\u003e 'true'\n\u003c%= isRelative('.') %\u003e\n//=\u003e 'true'\n\n// Windows\n\u003c%= isRelative('//server') %\u003e\n//=\u003e 'false'\n\u003c%= isRelative('C:/foo/..') %\u003e\n//=\u003e 'false'\n\u003c%= isRelative('bar\\\\baz') %\u003e\n//=\u003e 'true'\n\u003c%= isRelative('.') %\u003e\n//=\u003e 'true'\n```\n\n### string\n\n#### [camelcase](lib/helpers/string.js#L24)\n\ncamelCase the characters in `string`.\n\n**Params**\n\n* `string` **{String}**: The string to camelcase.\n* `returns` **{String}**\n\n**Example**\n\n```js\n\u003c%= camelcase(\"foo bar baz\") %\u003e\n//=\u003e 'fooBarBaz'\n```\n\n#### [centerAlign](lib/helpers/string.js#L46)\n\nCenter align the characters in a string using non-breaking spaces.\n\n**Params**\n\n* `str` **{String}**: The string to reverse.\n* `returns` **{String}**: Centered string.\n\n**Example**\n\n```js\n\u003c%= centerAlign(\"abc\") %\u003e\n```\n\n#### [chop](lib/helpers/string.js#L69)\n\nLike trim, but removes both extraneous whitespace and non-word characters from the beginning and end of a string.\n\n**Params**\n\n* `string` **{String}**: The string to chop.\n* `returns` **{String}**\n\n**Example**\n\n```js\n\u003c%= chop(\"_ABC_\") %\u003e\n//=\u003e 'ABC'\n\n\u003c%= chop(\"-ABC-\") %\u003e\n//=\u003e 'ABC'\n\n\u003c%= chop(\" ABC \") %\u003e\n//=\u003e 'ABC'\n```\n\n#### [count](lib/helpers/string.js#L88)\n\nCount the number of occurrances of a substring within a string.\n\n**Params**\n\n* `string` **{String}**\n* `substring` **{String}**\n* `returns` **{Number}**: The occurances of `substring` in `string`\n\n**Example**\n\n```js\n\u003c%= count(\"abcabcabc\", \"a\") %\u003e\n//=\u003e '3'\n```\n\n#### [dotcase](lib/helpers/string.js#L107)\n\ndot.case the characters in `string`.\n\n**Params**\n\n* `string` **{String}**\n* `returns` **{String}**\n\n**Example**\n\n```js\n\u003c%= dotcase(\"a-b-c d_e\") %\u003e\n//=\u003e 'a.b.c.d.e'\n```\n\n#### [ellipsis](lib/helpers/string.js#L128)\n\nTruncate a string to the specified `length`, and append it with an elipsis, `…`.\n\n**Params**\n\n* `str` **{String}**\n* `length` **{Number}**: The desired length of the returned string.\n* `ch` **{String}**: Optionally pass custom characters to append. Default is `…`.\n* `returns` **{String}**: The truncated string.\n\n**Example**\n\n```js\n\u003c%= ellipsis(\"\u003cspan\u003efoo bar baz\u003c/span\u003e\", 7) %\u003e\n//=\u003e 'foo bar…'\n```\n\n#### [isString](lib/helpers/string.js#L147)\n\nReturns true if the value is a string.\n\n**Params**\n\n* `val` **{String}**\n* `returns` **{Boolean}**: True if the value is a string.\n\n**Example**\n\n```js\n\u003c%= isString('abc') %\u003e\n//=\u003e 'true'\n\n\u003c%= isString(null) %\u003e\n//=\u003e 'false'\n```\n\n#### [lowercase](lib/helpers/string.js#L161)\n\nLowercase the characters in the given `string`.\n\n**Params**\n\n* `string` **{String}**: The string to lowercase.\n* `returns` **{String}**\n\n**Example**\n\n```js\n\u003c%= lowercase(\"ABC\") %\u003e\n//=\u003e 'abc'\n```\n\n#### [pascalcase](lib/helpers/string.js#L177)\n\nPascalCase the characters in `string`.\n\n**Params**\n\n* `string` **{String}**\n* `returns` **{String}**\n\n**Example**\n\n```js\n\u003c%= pascalcase(\"foo bar baz\") %\u003e\n//=\u003e 'FooBarBaz'\n```\n\n#### [snakecase](lib/helpers/string.js#L196)\n\nsnake_case the characters in `string`.\n\n**Params**\n\n* `string` **{String}**\n* `returns` **{String}**\n\n**Example**\n\n```js\n\u003c%= snakecase(\"a-b-c d_e\") %\u003e\n//=\u003e 'a_b_c_d_e'\n```\n\n#### [split](lib/helpers/string.js#L214)\n\nSplit `string` by the given `character`.\n\n**Params**\n\n* `string` **{String}**: The string to split.\n* `returns` **{String}** `character`: Default is `,`\n\n**Example**\n\n```js\n\u003c%= split(\"a,b,c\", \",\") %\u003e\n//=\u003e ['a', 'b', 'c']\n```\n\n#### [strip](lib/helpers/string.js#L230)\n\nStrip `substring` from the given `string`.\n\n**Params**\n\n* `substring` **{String|RegExp}**: The string or regex pattern of the substring to remove.\n* `string` **{String}**: The target string.\n\n**Example**\n\n```js\n\u003c%= strip(\"foo-bar\", \"foo-\") %\u003e\n//=\u003e 'bar'\n```\n\n#### [stripIndent](lib/helpers/string.js#L248)\n\nStrip the indentation from a `string`.\n\n**Params**\n\n* `string` **{String}**: The string to strip indentation from.\n* `returns` **{String}**\n\n**Example**\n\n```js\n\u003c%= stripIndent(\"  _ABC_\") %\u003e\n//=\u003e 'ABC'\n```\n\n#### [trim](lib/helpers/string.js#L275)\n\nTrim extraneous whitespace from the beginning and end of a string.\n\n**Params**\n\n* `string` **{String}**: The string to trim.\n* `returns` **{String}**\n\n**Example**\n\n```js\n\u003c%= trim(\"  ABC   \") %\u003e\n//=\u003e 'ABC'\n```\n\n#### [dashcase](lib/helpers/string.js#L291)\n\ndash-case the characters in `string`. This is similar to [slugify](https://github.com/simov/slugify), but [slugify](https://github.com/simov/slugify) makes the string compatible to be used as a URL slug.\n\n**Params**\n\n* `string` **{String}**\n* `returns` **{String}**\n\n**Example**\n\n```js\n\u003c%= dashcase(\"a b.c d_e\") %\u003e\n//=\u003e 'a-b-c-d-e'\n```\n\n#### [pathcase](lib/helpers/string.js#L309)\n\npath/case the characters in `string`.\n\n**Params**\n\n* `string` **{String}**\n* `returns` **{String}**\n\n**Example**\n\n```js\n\u003c%= pathcase(\"a-b-c d_e\") %\u003e\n//=\u003e 'a/b/c/d/e'\n```\n\n#### [sentencecase](lib/helpers/string.js#L327)\n\nSentence-case the characters in `string`.\n\n**Params**\n\n* `string` **{String}**\n* `returns` **{String}**\n\n**Example**\n\n```js\n\u003c%= sentencecase(\"foo bar baz.\") %\u003e\n//=\u003e 'Foo bar baz.'\n```\n\n#### [hyphenate](lib/helpers/string.js#L345)\n\nReplace spaces in a string with hyphens. This\n\n**Params**\n\n* `string` **{String}**\n* `returns` **{String}**\n\n**Example**\n\n```js\n\u003c%= hyphenate(\"a b c\") %\u003e\n//=\u003e 'a-b-c'\n```\n\n#### [reverse](lib/helpers/string.js#L377)\n\nReverse the characters in a string.\n\n**Params**\n\n* `str` **{String}**: The string to reverse.\n* `returns` **{String}**\n\n**Example**\n\n```js\n\u003c%= reverse(\"abc\") %\u003e\n//=\u003e 'cba'\n```\n\n#### [rightAlign](lib/helpers/string.js#L394)\n\nRight align the characters in a string using non-breaking spaces.\n\n**Params**\n\n* `str` **{String}**: The string to reverse.\n* `returns` **{String}**: Right-aligned string.\n\n**Example**\n\n```js\n\u003c%= rightAlign(str) %\u003e\n```\n\n#### [replace](lib/helpers/string.js#L412)\n\nReplace occurrences of `a` with `b`.\n\n**Params**\n\n* `str` **{String}**\n* `a` **{String|RegExp}**: Can be a string or regexp.\n* `b` **{String}**\n* `returns` **{String}**\n\n**Example**\n\n```js\n\u003c%= replace(\"abcabc\", /a/, \"z\") %\u003e\n//=\u003e 'zbczbc'\n```\n\n#### [titlecase](lib/helpers/string.js#L433)\n\nTruncate a string by removing all HTML tags and limiting the result to the specified `length`.\n\n**Params**\n\n* `str` **{String}**\n* `length` **{Number}**: The desired length of the returned string.\n* `returns` **{String}**: The truncated string.\n\n**Example**\n\n```js\n\u003c%= titlecase(\"big deal\") %\u003e\n//=\u003e 'foo bar'\n```\n\n#### [truncate](lib/helpers/string.js#L451)\n\nTruncate a string by removing all HTML tags and limiting the result to the specified `length`.\n\n**Params**\n\n* `str` **{String}**\n* `length` **{Number}**: The desired length of the returned string.\n* `returns` **{String}**: The truncated string.\n\n**Example**\n\n```js\n\u003c%= truncate(\"\u003cspan\u003efoo bar baz\u003c/span\u003e\", 7) %\u003e\n//=\u003e 'foo bar'\n```\n\n#### [uppercase](lib/helpers/string.js#L467)\n\nUppercase the characters in a string.\n\n**Params**\n\n* `string` **{String}**: The string to uppercase.\n* `returns` **{String}**\n\n**Example**\n\n```js\n\u003c%= uppercase(\"abc\") %\u003e\n//=\u003e 'ABC'\n```\n\n#### [wordwrap](lib/helpers/string.js#L484)\n\nWrap words to a specified width using [word-wrap](https://github.com/jonschlinkert/word-wrap).\n\n**Params**\n\n* `string` **{String}**: The string with words to wrap.\n* `object` **{Options}**: Options to pass to [word-wrap](https://github.com/jonschlinkert/word-wrap)\n* `returns` **{String}**: Formatted string.\n\n**Example**\n\n```js\n\u003c%= wordwrap(\"a b c d e f\", {width: 5, newline: '\u003cbr\u003e  '}) %\u003e\n//=\u003e '  a b c \u003cbr\u003e  d e f'\n```\n\n## Coverage\n\n```\nStatements   : 94.61% ( 439/464 )\nBranches     : 88.37% ( 190/215 )\nFunctions    : 96.94% ( 95/98 )\nLines        : 94.42% ( 389/412 )\n```\n\n## About\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eContributing\u003c/strong\u003e\u003c/summary\u003e\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eRunning Tests\u003c/strong\u003e\u003c/summary\u003e\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 \u0026\u0026 npm test\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eBuilding docs\u003c/strong\u003e\u003c/summary\u003e\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 \u0026\u0026 verb\n```\n\n\u003c/details\u003e\n\n### Related projects\n\nYou might also be interested in the following projects (also visit the [github.com/helpers](https://github.com/helpers), where you can find 60+ additional standalone helpers!):\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* [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### 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 24, 2018._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Ftemplate-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Ftemplate-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Ftemplate-helpers/lists"}