# swap-text

> Swap characters in a string.

Latest version **1.0.0** (published 2019-11-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install swap-text
pnpm add swap-text
yarn add swap-text
bun add swap-text
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-11-20 |
| First published | 2019-11-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 0 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Richie Bendall |
| Maintainers | richienb |
| Keywords | swap, text, characters, regex, change, positions |

## Links

- npm: https://www.npmjs.com/package/swap-text
- Repository: https://github.com/Richienb/swap-text
- npm.io page: https://npm.io/package/swap-text

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-11-20
- 0.0.0 — 2019-11-20

## README

# Swap text [![Travis CI Build Status](https://img.shields.io/travis/com/Richienb/swap-text/master.svg?style=for-the-badge)](https://travis-ci.com/Richienb/swap-text)

Swap characters in a string.

[![NPM Badge](https://nodei.co/npm/swap-text.png)](https://npmjs.com/package/swap-text)

## Install

```sh
npm install swap-text
```

## Usage

```js
const swapText = require("swap-text");

swapText("abcdef", "ab", "cd")
//=> 'cdabef'
```

## API

### swapText(string, a, b)

#### string

Type: `string`

The text to transform.

#### a

Type: `string`

The first group of characters to swap with the second.

#### b

Type: `string`

The second group of characters to swap with the first.

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