New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

handlebars-helper-range

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

handlebars-helper-range

Handlebars helper for generating a list of integers

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

handlebars-helper-range

A Handlebars helper for generating a range of integer values for block context.

npm Version Build Status Test Coverage Dependency Status

Installation

Install using npm:

$ npm install handlebars-helper-range

Usage

helpers.js

Example helpers file that requires in Handlebars and registers the range helper under the name "range".

var Handlebars = require('handlebars');

Handlebars.registerHelper('range', require('handlebars-helper-range'));

Once registered, templates will have access to the "range" helper which accepts up to three arguments: start (optional, defaults to 0, the start of the range), stop (the end of the range), and step (optional, defaults to 1, the value to increment or decrement by).

Example Templates

templates/example1.handlebars

Example template file that generates the list 0 through 9.

<ul>
  {{#range 10}}
    <li>{{this}}</li>
  {{/range}}
</ul>

templates/example2.handlebars

Example template file that generates the list 1 through 10.

<ul>
  {{#range 1 11}}
    <li>{{this}}</li>
  {{/range}}
</ul>

templates/example3.handlebars

Example template file that generates the list 0, 5, 10, 15.

<ul>
  {{#range 0 20 5}}
    <li>{{this}}</li>
  {{/range}}
</ul>

Changelog

1.1.1
  • No changes. Build fix.
1.1.0
  • Removed lodash dependency
1.0.0
  • Initial release

License

MIT

Keywords

FAQs

Package last updated on 28 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc