# convert-to-spaces

> Convert tabs to spaces in a string

Latest version **2.0.1** (published 2022-02-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install convert-to-spaces
pnpm add convert-to-spaces
yarn add convert-to-spaces
bun add convert-to-spaces
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2022-02-06 |
| First published | 2016-11-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | ^12.20.0 \|\| ^14.13.1 \|\| >=16.0.0 |
| Dependencies | 0 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Vadim Demedes |
| Maintainers | vdemedes |
| Keywords | tabs, spaces |

## Links

- npm: https://www.npmjs.com/package/convert-to-spaces
- Repository: https://github.com/vadimdemedes/convert-to-spaces
- Homepage: https://github.com/vadimdemedes/convert-to-spaces#readme
- Issues: https://github.com/vadimdemedes/convert-to-spaces/issues
- npm.io page: https://npm.io/package/convert-to-spaces

## Recent versions

- 2.0.1 (latest) — 2022-02-06
- 2.0.0 — 2022-02-06
- 1.0.2 — 2017-02-23
- 1.0.1 — 2016-11-13
- 1.0.0 — 2016-11-13

## README

# convert-to-spaces [![Build Status](https://github.com/vadimdemedes/convert-to-spaces/workflows/test/badge.svg)](https://github.com/vadimdemedes/convert-to-spaces/actions)

> Convert tabs to spaces in a string

## Install

```
$ npm install --save convert-to-spaces
```

## Usage

```js
import convertToSpaces from 'convert-to-spaces';

convertToSpaces('\t\thello!');
//=> '    hello!'
```

## API

### convertToSpaces(input, [spaces])

#### input

Type: `string`

String to convert.

#### 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.

---
_Source: https://npm.io/package/convert-to-spaces · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
