Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tomi77/handlebars-helpers-underscore.string
Wrap underscore.string functions to Handlebars helpers
https://github.com/tomi77/handlebars-helpers-underscore.string
handlebars handlebars-helpers string-manipulation
Last synced: about 2 hours ago
JSON representation
Wrap underscore.string functions to Handlebars helpers
- Host: GitHub
- URL: https://github.com/tomi77/handlebars-helpers-underscore.string
- Owner: tomi77
- License: mit
- Created: 2014-09-08T06:21:17.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2019-07-07T07:35:09.000Z (over 5 years ago)
- Last Synced: 2024-10-02T23:45:28.524Z (about 1 month ago)
- Topics: handlebars, handlebars-helpers, string-manipulation
- Language: JavaScript
- Size: 62.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/tomi77/handlebars-helpers-underscore.string.png)](https://travis-ci.org/tomi77/handlebars-helpers-underscore.string)
[![Coverage Status](https://img.shields.io/coveralls/tomi77/handlebars-helpers-underscore.string.svg)](https://coveralls.io/r/tomi77/handlebars-helpers-underscore.string)
[![Code Climate](https://codeclimate.com/github/tomi77/handlebars-helpers-underscore.string/badges/gpa.svg)](https://codeclimate.com/github/tomi77/handlebars-helpers-underscore.string)
[![Dependency Status](https://david-dm.org/tomi77/handlebars-helpers-underscore.string.svg)](https://david-dm.org/tomi77/handlebars-helpers-underscore.string)
[![devDependency Status](https://david-dm.org/tomi77/handlebars-helpers-underscore.string/dev-status.svg)](https://david-dm.org/tomi77/handlebars-helpers-underscore.string?type=dev)
[![peerDependency Status](https://david-dm.org/tomi77/handlebars-helpers-underscore.string/peer-status.svg)](https://david-dm.org/tomi77/handlebars-helpers-underscore.string?type=peer)
![Downloads](https://img.shields.io/npm/dt/handlebars-helpers-underscore.string.svg)handlebars-helpers-underscore.string
====================================Wrap [underscore.string](http://gabceb.github.io/underscore.string.site/) functions to [Handlebars](http://handlebarsjs.com/) helpers
## Installation
Via ``bower``:
~~~bash
bower install handlebars-helpers-underscore.string
~~~Via ``npm``:
~~~bash
npm install handlebars-helpers-underscore.string
~~~## Usage
In ``node``:
~~~js
Handlebars = require('handlebars');
require('handlebars-helpers-underscore.string');var source = "
Hello, my name is {{name}}. I am from {{underscored hometown}}. I have " +
" +
"{{kids.length}} kids:
"
- {{#kids}}
- {{name}} is {{age}} {{/kids}}
var template = Handlebars.compile(source);
var data = { "name": "Alan", "hometown": "Somewhere, TX",
"kids": [{"name": "Jimmy", "age": "12"}, {"name": "Sally", "age": "4"}]};
var result = template(data);
// Would render:
//
Hello, my name is Alan. I am from somewhere,_tx. I have 2 kids:
//
- Jimmy is 12
- Sally is 4
//
//
//
~~~
In ``webpack`` remember to set `node.fs` to `empty`.