3.0.0 • Published 3 years ago

lpad v3.0.0

Weekly downloads
31,914
License
MIT
Repository
github
Last release
3 years ago

lpad

Left-pad each line in a string

npm.io

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.