Skip to content
Left pad each line in a string
JavaScript
Latest commit f0a5ce3 Apr 22, 2016 @SamVerschueren SamVerschueren committed with πŸ’„ (#4)
Failed to load latest commit information.
.editorconfig πŸ’„ (#4) Apr 22, 2016
.gitattributes tweaks Aug 13, 2014
.gitignore [breaking] simplify API Mar 7, 2014
.travis.yml πŸ’„ (#4) Apr 22, 2016
index.js Use split-lines (#3) Apr 21, 2016
license tweaks Aug 13, 2014
package.json πŸ’„ (#4) Apr 22, 2016
readme.md πŸ’„ (#4) Apr 22, 2016
screenshot.png init Mar 18, 2013
test.js πŸ’„ (#4) Apr 22, 2016

readme.md

lpad Build Status

Left pad each line in a string

Install

$ npm install --save lpad

Usage

const lpad = require('lpad');

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

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

API

lpad(input, pad)

Pads each line in a string with the supplied string.

input

Type: string

String that will be padded.

pad

Type: string

String that will be prepended to each line.

License

MIT Β© Sindre Sorhus

Something went wrong with that request. Please try again.