Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tornqvist/jazzon-repeat

Repeat given value n number of times
https://github.com/tornqvist/jazzon-repeat

Last synced: about 1 month ago
JSON representation

Repeat given value n number of times

Awesome Lists containing this project

README

        

# jazzon-repeat

> Repeat given value n number of times

## Installation

```bash
$ npm install --save jazzon-repeat
```

## Usage

The helper "repeat" clones (deep) the current state given number of times and puts them in an array.

```javascript
let jazzon = require('jazzon');
let repeat = require('jazzon-repeat');

jazzon
.use(repeat())
.compile({ foo: '@{ random(1, 10) | repeat(3) }'})
.then(result => console.log(result)) // => {foo: [7, 7, 7]}
```