source: trip-planner-front/node_modules/indent-string/readme.md@ 571e0df

Last change on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[6a3a178]1# indent-string [![Build Status](https://travis-ci.org/sindresorhus/indent-string.svg?branch=master)](https://travis-ci.org/sindresorhus/indent-string)
2
3> Indent each line in a string
4
5
6## Install
7
8```
9$ npm install indent-string
10```
11
12
13## Usage
14
15```js
16const indentString = require('indent-string');
17
18indentString('Unicorns\nRainbows', 4);
19//=> ' Unicorns\n Rainbows'
20
21indentString('Unicorns\nRainbows', 4, {indent: '♥'});
22//=> '♥♥♥♥Unicorns\n♥♥♥♥Rainbows'
23```
24
25
26## API
27
28### indentString(string, [count], [options])
29
30#### string
31
32Type: `string`
33
34The string to indent.
35
36#### count
37
38Type: `number`<br>
39Default: `1`
40
41How many times you want `options.indent` repeated.
42
43#### options
44
45Type: `object`
46
47##### indent
48
49Type: `string`<br>
50Default: `' '`
51
52The string to use for the indent.
53
54##### includeEmptyLines
55
56Type: `boolean`<br>
57Default: `false`
58
59Also indent empty lines.
60
61
62## Related
63
64- [indent-string-cli](https://github.com/sindresorhus/indent-string-cli) - CLI for this module
65- [strip-indent](https://github.com/sindresorhus/strip-indent) - Strip leading whitespace from every line in a string
66
67
68## License
69
70MIT © [Sindre Sorhus](https://sindresorhus.com)
Note: See TracBrowser for help on using the repository browser.