blob: 9eccf42d0bfaf16e3dfff5389035f6ba86e0e02d (
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
|
# convert-to-spaces [](https://travis-ci.org/vadimdemedes/convert-to-spaces)
> Convert tabs to spaces in a string
## Install
```
$ npm install --save convert-to-spaces
```
## Usage
```js
const convertToSpaces = require('convert-to-spaces');
convertToSpaces('\t\thello!');
//=> ' hello!'
```
## API
### convertToSpaces(str, [spaces])
#### str
Type: `string`
Source string.
#### spaces
Type: `number`<br>
Default: `2`
Number of spaces instead of each tab.
## Related
- [convert-to-tabs](https://github.com/vadimdemedes/convert-to-tabs) - Convert spaces to tabs.
## License
MIT © [Vadim Demedes](https://vadimdemedes.com)
|