lpad
Left-pad each line in a string
Last updated 5 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm 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 (5 years ago)

7 Versions

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

Copyright 2013 - present © cnpmjs.org | Home |