{"id":15646279,"url":"https://github.com/jonschlinkert/repeat-string","last_synced_at":"2025-04-05T03:12:40.288Z","repository":{"id":15458242,"uuid":"18191306","full_name":"jonschlinkert/repeat-string","owner":"jonschlinkert","description":"Repeat the given string n times. Fastest implementation for repeating a string (2x faster than the native method)","archived":false,"fork":false,"pushed_at":"2022-01-17T05:08:54.000Z","size":61,"stargazers_count":49,"open_issues_count":4,"forks_count":17,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-29T21:02:03.477Z","etag":null,"topics":["es","javascript","jonschlinkert","node","nodejs","repeat","repeat-string","repeating","string"],"latest_commit_sha":null,"homepage":"https://github.com/jonschlinkert","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonschlinkert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-27T21:02:32.000Z","updated_at":"2024-02-06T06:20:58.000Z","dependencies_parsed_at":"2022-08-25T18:30:13.756Z","dependency_job_id":null,"html_url":"https://github.com/jonschlinkert/repeat-string","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Frepeat-string","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Frepeat-string/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Frepeat-string/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Frepeat-string/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/repeat-string/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247280272,"owners_count":20912967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["es","javascript","jonschlinkert","node","nodejs","repeat","repeat-string","repeating","string"],"created_at":"2024-10-03T12:12:11.818Z","updated_at":"2025-04-05T03:12:40.258Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# repeat-string [![NPM version](https://img.shields.io/npm/v/repeat-string.svg?style=flat)](https://www.npmjs.com/package/repeat-string) [![NPM monthly downloads](https://img.shields.io/npm/dm/repeat-string.svg?style=flat)](https://npmjs.org/package/repeat-string)  [![NPM total downloads](https://img.shields.io/npm/dt/repeat-string.svg?style=flat)](https://npmjs.org/package/repeat-string) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/repeat-string.svg?style=flat\u0026label=Travis)](https://travis-ci.org/jonschlinkert/repeat-string)\n\n\u003e Repeat the given string n times. Fastest implementation for repeating a string.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save repeat-string\n```\n\n## Usage\n\n### [repeat](index.js#L41)\n\nRepeat the given `string` the specified `number` of times.\n\n**Example:**\n\n**Example**\n\n```js\nvar repeat = require('repeat-string');\nrepeat('A', 5);\n//=\u003e AAAAA\n```\n\n**Params**\n\n* `string` **{String}**: The string to repeat\n* `number` **{Number}**: The number of times to repeat the string\n* `returns` **{String}**: Repeated string\n\n## Benchmarks\n\nRepeat string is significantly faster than the native method (which is itself faster than [repeating](https://github.com/sindresorhus/repeating)):\n\n```sh\n# 2x\nrepeat-string  █████████████████████████  (26,953,977 ops/sec)\nrepeating      █████████                  (9,855,695 ops/sec)\nnative         ██████████████████         (19,453,895 ops/sec)\n\n# 3x\nrepeat-string  █████████████████████████  (19,445,252 ops/sec)\nrepeating      ███████████                (8,661,565 ops/sec)\nnative         ████████████████████       (16,020,598 ops/sec)\n\n# 10x\nrepeat-string  █████████████████████████  (23,792,521 ops/sec)\nrepeating      █████████                  (8,571,332 ops/sec)\nnative         ███████████████            (14,582,955 ops/sec)\n\n# 50x\nrepeat-string  █████████████████████████  (23,640,179 ops/sec)\nrepeating      █████                      (5,505,509 ops/sec)\nnative         ██████████                 (10,085,557 ops/sec)\n\n# 250x\nrepeat-string  █████████████████████████  (23,489,618 ops/sec)\nrepeating      ████                       (3,962,937 ops/sec)\nnative         ████████                   (7,724,892 ops/sec)\n\n# 2000x\nrepeat-string  █████████████████████████  (20,315,172 ops/sec)\nrepeating      ████                       (3,297,079 ops/sec)\nnative         ███████                    (6,203,331 ops/sec)\n\n# 20000x\nrepeat-string  █████████████████████████  (23,382,915 ops/sec)\nrepeating      ███                        (2,980,058 ops/sec)\nnative         █████                      (5,578,808 ops/sec)\n```\n\n**Run the benchmarks**\n\nInstall dev dependencies:\n\n```sh\nnpm i -d \u0026\u0026 node benchmark\n```\n\n## About\n\n### Related projects\n\n[repeat-element](https://www.npmjs.com/package/repeat-element): Create an array by repeating the given value n times. | [homepage](https://github.com/jonschlinkert/repeat-element \"Create an array by repeating the given value n times.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\nPlease read the [contributing guide](.github/contributing.md) for avice on opening issues, pull requests, and coding standards.\n\n### Contributors\n\n| **Commits** | **Contributor**\u003cbr/\u003e | \n| --- | --- |\n| 61 | [jonschlinkert](https://github.com/jonschlinkert) |\n| 2 | [LinusU](https://github.com/LinusU) |\n| 2 | [tbusser](https://github.com/tbusser) |\n| 1 | [doowb](https://github.com/doowb) |\n| 1 | [wooorm](https://github.com/wooorm) |\n\n### Building docs\n\n_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_\n\nTo generate the readme and API documentation with [verb](https://github.com/verbose/verb):\n\n```sh\n$ npm install -g verb verb-generate-readme \u0026\u0026 verb\n```\n\n### Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm install -d \u0026\u0026 npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2016, [Jon Schlinkert](http://github.com/jonschlinkert).\nReleased under the [MIT license](https://github.com/jonschlinkert/repeat-string/blob/master/LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on November 03, 2016._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Frepeat-string","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Frepeat-string","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Frepeat-string/lists"}