Distopico Vegan 9e639edc8d | 6 years ago | |
---|---|---|
.. | ||
index.js | 6 years ago | |
license | 6 years ago | |
package.json | 6 years ago | |
readme.md | 6 years ago |
Indent each line in a string
$ npm install indent-string
const indentString = require('indent-string');
indentString('Unicorns\nRainbows', 4);
//=> ' Unicorns'
//=> ' Rainbows'
indentString('Unicorns\nRainbows', 4, {indent: '♥'});
//=> '♥♥♥♥Unicorns'
//=> '♥♥♥♥Rainbows'
Type: string
String you want to indent.
Type: number
Default: 1
How many times you want indent
repeated.
Type: Object
Type: string
Default: ' '
String to use for the indent.
Type: boolean
Default: false
Also indent empty lines.
MIT © Sindre Sorhus