Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@stdlib/string-repeat

Package Overview
Dependencies
Maintainers
4
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stdlib/string-repeat - npm Package Compare versions

Comparing version
0.0.7
to
0.0.8
+1
-0
docs/usage.txt

@@ -9,2 +9,3 @@

--n repeats Number of repetitions.
--split sep Delimiter for stdin data. Default: '/\\r?\\n/'.
+2
-1

@@ -7,3 +7,4 @@ {

"string": [
"n"
"n",
"split"
],

@@ -10,0 +11,0 @@ "alias": {

+1
-1

@@ -1,1 +0,1 @@

Copyright (c) 2016-2021 The Stdlib Authors.
Copyright (c) 2016-2022 The Stdlib Authors.
{
"name": "@stdlib/string-repeat",
"version": "0.0.7",
"version": "0.0.8",
"description": "Repeat a string a specified number of times and return the concatenated result.",

@@ -44,2 +44,3 @@ "license": "Apache-2.0",

"@stdlib/assert-is-nonnegative-integer": "^0.0.x",
"@stdlib/assert-is-regexp-string": "^0.0.x",
"@stdlib/assert-is-string": "^0.0.x",

@@ -51,3 +52,4 @@ "@stdlib/cli-ctor": "^0.0.x",

"@stdlib/regexp-eol": "^0.0.x",
"@stdlib/streams-node-stdin": "^0.0.x"
"@stdlib/streams-node-stdin": "^0.0.x",
"@stdlib/utils-regexp-from-string": "^0.0.x"
},

@@ -54,0 +56,0 @@ "devDependencies": {

@@ -23,3 +23,3 @@ <!--

[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] [![dependencies][dependencies-image]][dependencies-url]
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->

@@ -108,2 +108,4 @@ > Repeat a string a specified number of times and return the concatenated result.

<!-- CLI usage documentation. -->
<section class="usage">

@@ -127,2 +129,24 @@

<!-- CLI usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
<section class="notes">
### Notes
- If the split separator is a [regular expression][mdn-regexp], ensure that the `split` option is either properly escaped or enclosed in quotes.
```bash
# Not escaped...
$ echo -n $'beep\nboop' | repstr --n 3 --split /\r?\n/
# Escaped...
$ echo -n $'beep\nboop' | repstr --n 3 --split /\\r?\\n/
```
- The implementation ignores trailing delimiters.
</section>
<!-- /.notes -->
<section class="examples">

@@ -133,3 +157,3 @@

```bash
$ repstr beep -n 5
$ repstr beep --n 5
beepbeepbeepbeepbeep

@@ -141,6 +165,14 @@ ```

```bash
$ echo -n 'ab' | repstr -n 3
$ echo -n $'ab' | repstr --n 3
ababab
```
By default, when used as a [standard stream][standard-streams], the implementation assumes newline-delimited data. To specify an alternative delimiter, set the `split` option.
```bash
$ echo -n $'beep\tboop' | repstr --n 3 --split '\t'
beepbeepbeep
boopboopboop
```
</section>

@@ -154,3 +186,19 @@

<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
<section class="related">
* * *
## See Also
- <span class="package-name">[`@stdlib/string/pad`][@stdlib/string/pad]</span><span class="delimiter">: </span><span class="description">pad a string.</span>
</section>
<!-- /.related -->
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
<section class="main-repo" >

@@ -179,3 +227,3 @@

Copyright &copy; 2016-2021. The Stdlib [Authors][stdlib-authors].
Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].

@@ -199,5 +247,16 @@ </section>

<!--
[dependencies-image]: https://img.shields.io/david/stdlib-js/string-repeat.svg
[dependencies-url]: https://david-dm.org/stdlib-js/string-repeat/main
-->
[umd]: https://github.com/umdjs/umd
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
[deno-url]: https://github.com/stdlib-js/string-repeat/tree/deno
[umd-url]: https://github.com/stdlib-js/string-repeat/tree/umd
[esm-url]: https://github.com/stdlib-js/string-repeat/tree/esm
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg

@@ -214,4 +273,12 @@ [chat-url]: https://gitter.im/stdlib-js/stdlib/

[mdn-regexp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
<!-- <related-links> -->
[@stdlib/string/pad]: https://www.npmjs.com/package/@stdlib/string-pad
<!-- </related-links> -->
</section>
<!-- /.links -->

Sorry, the diff of this file is not supported yet