1 # repeat-string [](http://badge.fury.io/js/repeat-string) [](https://travis-ci.org/jonschlinkert/repeat-string)
3 > Repeat the given string n times. Fastest implementation for repeating a string.
5 ## Install with [npm](npmjs.org)
8 npm i repeat-string --save
10 ## Install with [bower](https://github.com/bower/bower)
13 bower install repeat-string --save
18 ### [repeat](./index.js#L34)
20 Repeat the given `string` the specified `number` of times.
22 * `string` **{String}**: The string to repeat
23 * `number` **{Number}**: The number of times to repeat the string
24 * `returns` **{String}**: Repeated string
29 var repeat = require('repeat-string');
36 Repeat string is significantly faster than [repeating](https://github.com/sindresorhus/repeating).
40 repeat-string.js x 16,634,213 ops/sec ±0.92% (93 runs sampled)
41 repeating.js x 5,883,928 ops/sec ±0.95% (93 runs sampled)
44 repeat-string.js x 17,438,654 ops/sec ±0.76% (97 runs sampled)
45 repeating.js x 6,639,978 ops/sec ±0.84% (97 runs sampled)
48 repeat-string.js x 16,246,885 ops/sec ±0.81% (92 runs sampled)
49 repeating.js x 7,659,342 ops/sec ±0.67% (99 runs sampled)
52 repeat-string.js x 15,803,340 ops/sec ±0.74% (92 runs sampled)
53 repeating.js x 9,668,300 ops/sec ±0.89% (98 runs sampled)
56 repeat-string.js x 16,926,291 ops/sec ±0.78% (97 runs sampled)
57 repeating.js x 12,215,384 ops/sec ±1.01% (96 runs sampled)
60 **Run the benchmarks**
62 Install dev dependencies:
65 npm i -d && node benchmark
68 ### Other javascript/node.js utils
69 [repeat-element](https://github.com/jonschlinkert/repeat-element): Create an array by repeating the given string n times.
72 Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/repeat-string/issues)
75 Install dev dependencies:
85 + [github/jonschlinkert](https://github.com/jonschlinkert)
86 + [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
89 Copyright (c) 2015 Jon Schlinkert
90 Released under the MIT license
94 _This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on April 01, 2015._