The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.
When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.
Repeat a string a specified number of times and return the concatenated result.
To use as a general utility, install the CLI package globally
npm install -g @stdlib/string-repeat-cli
Usage: repstr [options] [<string>] --n <repeats> Options: -h, --help Print this message. -V, --version Print the package version. --n repeats Number of repetitions.
$ repstr beep --n 5 beepbeepbeepbeepbeep
To use as a standard stream,
$ echo -n $'ab' | repstr --n 3 ababab
By default, when used as a standard stream, the implementation assumes newline-delimited data. To specify an alternative delimiter, set the
$ echo -n $'beep\tboop' | repstr --n 3 --split '\t' beepbeepbeep boopboopboop
Copyright © 2016-2023. The Stdlib Authors.