blob: 8e7a807630ca5590890d028fd604a0d9db974bcb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# redent [![Build Status](https://travis-ci.org/sindresorhus/redent.svg?branch=master)](https://travis-ci.org/sindresorhus/redent)
> [Strip redundant indentation](https://github.com/sindresorhus/strip-indent) and [indent the string](https://github.com/sindresorhus/indent-string)
## Install
```
$ npm install --save redent
```
## Usage
```js
const redent = require('redent');
redent('\n foo\n bar\n', 1);
//=> '\n foo\n bar\n'
```
## API
### redent(input, [count], [indent])
#### input
Type: `string`
#### count
Type: `number`
Default: `0`
How many times you want `indent` repeated.
#### indent
Type: `string`
Default: `' '`
The string to use for the indent.
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)
|