Leming1488 / indent-string

Indent each line in a string

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

indent-string Build Status

Indent each line in a string

Install

$ npm install --save indent-string

Usage

const indentString = require('indent-string');

indentString('Unicorns\nRainbows', 4);
//=> '    Unicorns'
//=> '    Rainbows'

indentString('Unicorns\nRainbows', 4, '♥');
//=> '♥♥♥♥Unicorns'
//=> '♥♥♥♥Rainbows'

API

indentString(input, [count], [indent])

input

Type: string

String you want to indent.

count

Type: number
Default: 1

How many times you want indent repeated.

indent

Type: string
Default: ' '

String to use for the indent.

Related

License

MIT © Sindre Sorhus

About

Indent each line in a string

License:MIT License


Languages

Language:JavaScript 100.0%