lpad

3.0.0 • Public • Published

lpad

Left-pad each line in a string

Install

$ npm install lpad

Usage

import leftPad from 'lpad';

const string = 'foo\nbar';
/*
foo
bar
*/

lpad(string, '    ');
/*
    foo
    bar
*/

API

lpad(string, padString)

Pads each line in a string with the supplied string.

string

Type: string

String that will be padded.

padString

Type: string

String that will be prepended to each line.

Dependents (11)

Package Sidebar

Install

npm i lpad

Weekly Downloads

24,045

Version

3.0.0

License

MIT

Unpacked Size

2.58 kB

Total Files

4

Last publish

Collaborators

  • sindresorhus