Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

handlebars-helper-repeat

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

handlebars-helper-repeat

Repeat the encapsulated block of content _n_ times.

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
437
increased by122.96%
Maintainers
1
Weekly downloads
 
Created
Source

{{repeat}} NPM version

Repeat the encapsulated block of content n times.

Quickstart

In the root of your project, run the following in the command line:

npm i handlebars-helper-repeat --save-dev

Usage

{{#repeat '10'}}
   {{> button }}
{{/repeat}}

Usage in Assemble

In your Gruntfile, simply add handlebars-helper-repeat to the helpers property in the Assemble task or target options:

grunt.initConfig({
  assemble: {
    options: {
      helpers: ['handlebars-helper-repeat']
    }
    ...
  }
});

With that completed, you may now being using the {{repeat}} helper in your Assemble project.

Options

task options

Options can be set in your Gruntfile, in a custom property in the Assemble task or target options:

grunt.initConfig({
  assemble: {
    options: {
      number: {
        foo: 10,
        bar: 5
      }
    }
    ...
  }
});

Example usage with custom properties:

---
number:
  foo: <%= number.foo >
  bar: <%= number.bar >
---

{{#repeat number.foo}}
   {{> foo-button }}
{{/repeat}}


{{#repeat number.bar}}
   {{> bar-button }}
{{/repeat}}

Author

Licensed under the MIT License Copyright (c) Jon Schlinkert, contributors.

Keywords

FAQs

Package last updated on 03 Nov 2013

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