# utils-repeat-string

> Repeat a string a specified number of times and return the concatenated result.

Latest version **1.0.3** (published 2016-01-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install utils-repeat-string
pnpm add utils-repeat-string
yarn add utils-repeat-string
bun add utils-repeat-string
```

Provides the command `repstr`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2016-01-15 |
| First published | 2016-01-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Athan Reines |
| Maintainers | kgryte |
| Keywords | utilities, utility, utils, util, repeat, string, str, rep, tile, replicate, copy, repstr, cli |

## Links

- npm: https://www.npmjs.com/package/utils-repeat-string
- Repository: https://github.com/kgryte/utils-repeat-string
- Homepage: https://github.com/kgryte/utils-repeat-string#readme
- Issues: https://github.com/kgryte/utils-repeat-string/issues
- npm.io page: https://npm.io/package/utils-repeat-string

## Dependencies (5)

- [pkginfo](https://npm.io/package/pkginfo.md) ^0.3.1
- [minimist](https://npm.io/package/minimist.md) ^1.2.0
- [update-notifier](https://npm.io/package/update-notifier.md) ^0.6.0
- [validate.io-string-primitive](https://npm.io/package/validate.io-string-primitive.md) ^1.0.0
- [validate.io-nonnegative-integer](https://npm.io/package/validate.io-nonnegative-integer.md) ^1.0.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2016-01-15
- 1.0.2 — 2016-01-15
- 1.0.1 — 2016-01-15
- 1.0.0 — 2016-01-15
- 0.0.0 — 2016-01-15

## README

Repeat
===
[![NPM version][npm-image]][npm-url] [![Build Status][build-image]][build-url] [![Coverage Status][coverage-image]][coverage-url] [![Dependencies][dependencies-image]][dependencies-url]

> Repeat a string a specified number of times and return the concatenated result.


## Installation

``` bash
$ npm install utils-repeat-string
```


## Usage

``` javascript
var repeat = require( 'utils-repeat-string' );
```

#### repeat( str, n )

Repeats a string `n` times and returns the concatenated result.

``` javascript
var str = repeat( 'a', 5 );
// returns 'aaaaa'

str = repeat( '', 100 );
// returns ''

str = repeat( 'beep', 0 );
// returns ''
```


## Examples

``` javascript
var round = require( 'math-round' );
var repeat = require( 'utils-repeat-string' );

var str = 'beep';
var n;
var i;

for ( i = 0; i < 100; i++ ) {
	n = round( Math.random()*3 );
	console.log( repeat( str, n ) );
}
```

To run the example code from the top-level application directory,

``` bash
$ node ./examples/index.js
```


---
## CLI

### Installation

To use the module as a general utility, install the module globally

``` bash
$ npm install -g utils-repeat-string
```


### Usage

``` bash
Usage: repstr [options] str --n repeats

Options:

  -h,    --help                Print this message.
  -V,    --version             Print the package version.
         --n repeats           Number of repetitions.
```


### Examples

``` bash
$ repstr beep -n 5
# => beepbeepbeepbeepbeep
```


---
## Tests

### Unit

This repository uses [tape][tape] for unit tests. To run the tests, execute the following command in the top-level application directory:

``` bash
$ make test
```

All new feature development should have corresponding unit tests to validate correct functionality.


### Test Coverage

This repository uses [Istanbul][istanbul] as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:

``` bash
$ make test-cov
```

Istanbul creates a `./reports/coverage` directory. To access an HTML version of the report,

``` bash
$ make view-cov
```


### Browser Support

This repository uses [Testling][testling] for browser testing. To run the tests in a (headless) local web browser, execute the following command in the top-level application directory:

``` bash
$ make test-browsers
```

To view the tests in a local web browser,

``` bash
$ make view-browser-tests
```

<!-- [![browser support][browsers-image]][browsers-url] -->


---
## License

[MIT license](http://opensource.org/licenses/MIT).


## Copyright

Copyright &copy; 2016. Athan Reines.


[npm-image]: http://img.shields.io/npm/v/utils-repeat-string.svg
[npm-url]: https://npmjs.org/package/utils-repeat-string

[build-image]: http://img.shields.io/travis/kgryte/utils-repeat-string/master.svg
[build-url]: https://travis-ci.org/kgryte/utils-repeat-string

[coverage-image]: https://img.shields.io/codecov/c/github/kgryte/utils-repeat-string/master.svg
[coverage-url]: https://codecov.io/github/kgryte/utils-repeat-string?branch=master

[dependencies-image]: http://img.shields.io/david/kgryte/utils-repeat-string.svg
[dependencies-url]: https://david-dm.org/kgryte/utils-repeat-string

[dev-dependencies-image]: http://img.shields.io/david/dev/kgryte/utils-repeat-string.svg
[dev-dependencies-url]: https://david-dm.org/dev/kgryte/utils-repeat-string

[github-issues-image]: http://img.shields.io/github/issues/kgryte/utils-repeat-string.svg
[github-issues-url]: https://github.com/kgryte/utils-repeat-string/issues

[tape]: https://github.com/substack/tape
[istanbul]: https://github.com/gotwarlost/istanbul
[testling]: https://ci.testling.com

---
_Source: https://npm.io/package/utils-repeat-string · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
