lpad
Left-pad each line in a string
Last updated 6 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install lpad 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 3.0.0                                ...           latest (6 years ago)

7 Versions

  • 3.0.0                                ...           6 years ago
  • 2.0.1                                ...           11 years ago
  • 2.0.0                                ...           12 years ago
  • 1.0.0                                ...           12 years ago
  • 0.2.1                                ...           13 years ago
  • 0.2.0                                ...           13 years ago
  • 0.1.0                                ...           14 years ago
Maintainers (1)
Downloads
Total 13
Today 0
This Week 0
This Month 12
Last Day 0
Last Week 3
Last Month 0
Dependencies (1)
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE