@stdlib/string-left-pad
Advanced tools
+1
-1
@@ -10,2 +10,2 @@ | ||
| --pad str String used to pad. Default: ' '. | ||
| --split sep Delimiter for stdin data. Default: '/\\r?\\n/'. |
@@ -8,3 +8,4 @@ { | ||
| "len", | ||
| "pad" | ||
| "pad", | ||
| "split" | ||
| ], | ||
@@ -11,0 +12,0 @@ "alias": { |
+1
-1
@@ -1,1 +0,1 @@ | ||
| Copyright (c) 2016-2021 The Stdlib Authors. | ||
| Copyright (c) 2016-2022 The Stdlib Authors. |
+4
-2
| { | ||
| "name": "@stdlib/string-left-pad", | ||
| "version": "0.0.7", | ||
| "version": "0.0.8", | ||
| "description": "Left pad a string.", | ||
@@ -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", | ||
@@ -53,3 +54,4 @@ "@stdlib/cli-ctor": "^0.0.x", | ||
| "@stdlib/streams-node-stdin": "^0.0.x", | ||
| "@stdlib/string-repeat": "^0.0.x" | ||
| "@stdlib/string-repeat": "^0.0.x", | ||
| "@stdlib/utils-regexp-from-string": "^0.0.x" | ||
| }, | ||
@@ -56,0 +58,0 @@ "devDependencies": { |
+73
-2
@@ -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] --> | ||
@@ -130,2 +130,4 @@ > Left pad a string. | ||
| <!-- CLI usage documentation. --> | ||
| <section class="usage"> | ||
@@ -144,2 +146,3 @@ | ||
| --pad str String used to pad. Default: ' '. | ||
| --split sep Delimiter for stdin data. Default: '/\\r?\\n/'. | ||
| ``` | ||
@@ -151,2 +154,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' | lpad -len 8 --split /\r?\n/ | ||
| # Escaped... | ||
| $ echo -n $'beep\nboop' | lpad -len 8 --split /\\r?\\n/ | ||
| ``` | ||
| - The implementation ignores trailing delimiters. | ||
| </section> | ||
| <!-- /.notes --> | ||
| <section class="examples"> | ||
@@ -168,2 +193,10 @@ | ||
| 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 'boop\tbeep' | lpad --len 8 --split '\t' | ||
| boop | ||
| beep | ||
| ``` | ||
| </section> | ||
@@ -177,3 +210,20 @@ | ||
| <!-- 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> | ||
| - <span class="package-name">[`@stdlib/string/right-pad`][@stdlib/string/right-pad]</span><span class="delimiter">: </span><span class="description">right 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" > | ||
@@ -202,3 +252,3 @@ | ||
| Copyright © 2016-2021. The Stdlib [Authors][stdlib-authors]. | ||
| Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors]. | ||
@@ -222,5 +272,16 @@ </section> | ||
| <!-- | ||
| [dependencies-image]: https://img.shields.io/david/stdlib-js/string-left-pad.svg | ||
| [dependencies-url]: https://david-dm.org/stdlib-js/string-left-pad/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-left-pad/tree/deno | ||
| [umd-url]: https://github.com/stdlib-js/string-left-pad/tree/umd | ||
| [esm-url]: https://github.com/stdlib-js/string-left-pad/tree/esm | ||
| [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg | ||
@@ -237,4 +298,14 @@ [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 | ||
| [@stdlib/string/right-pad]: https://www.npmjs.com/package/@stdlib/string-right-pad | ||
| <!-- </related-links> --> | ||
| </section> | ||
| <!-- /.links --> |
Sorry, the diff of this file is not supported yet
45398
6.84%237
0.42%303
30.6%12
20%