Initial commit
[yaffs-website] / node_modules / repeat-element / README.md
1 # repeat-element [![NPM version](https://badge.fury.io/js/repeat-element.svg)](http://badge.fury.io/js/repeat-element)
2
3 > Create an array by repeating the given value n times.
4
5 ## Install
6
7 Install with [npm](https://www.npmjs.com/)
8
9 ```bash
10 npm i repeat-element --save
11 ```
12
13 ## Usage
14
15 ```js
16 var repeat = require('repeat-element');
17
18 repeat('a', 5);
19 //=> ['a', 'a', 'a', 'a', 'a']
20
21 repeat('a', 1);
22 //=> ['a']
23
24 repeat('a', 0);
25 //=> []
26
27 repeat(null, 5)
28 //» [ null, null, null, null, null ]
29
30 repeat({some: 'object'}, 5)
31 //» [ { some: 'object' },
32 //    { some: 'object' },
33 //    { some: 'object' },
34 //    { some: 'object' },
35 //    { some: 'object' } ]
36
37 repeat(5, 5)
38 //» [ 5, 5, 5, 5, 5 ]
39 ```
40
41 ## Related projects
42
43 [repeat-string](https://github.com/jonschlinkert/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string.
44
45 ## Running tests
46
47 Install dev dependencies:
48
49 ```bash
50 npm i -d && npm test
51 ```
52
53 ## Contributing
54
55 Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/repeat-element/issues)
56
57 ## Author
58
59 **Jon Schlinkert**
60
61 + [github/jonschlinkert](https://github.com/jonschlinkert)
62 + [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
63
64 ## License
65
66 Copyright (c) 2015 Jon Schlinkert
67 Released under the MIT license.
68
69 ***
70
71 _This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on May 06, 2015._