# alter

> alters a string by replacing multiple range fragments in one fast pass

Latest version **0.2.0** (published 2013-09-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install alter
pnpm add alter
yarn add alter
bun add alter
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2013-09-08 |
| First published | 2013-04-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Olov Lassus |
| Maintainers | olov |
| Keywords | string, manipulation, replace, alter, modify |

## Links

- npm: https://www.npmjs.com/package/alter
- Repository: https://github.com/olov/alter
- npm.io page: https://npm.io/package/alter

## Dependencies (1)

- [stable](https://npm.io/package/stable.md) ~0.1.3

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

- 0.2.0 (latest) — 2013-09-08
- 0.1.1 — 2013-04-21
- 0.1.0 — 2013-04-21

## README

# alter.js
Alters a string by replacing multiple range fragments in one fast pass.
Works in node and browsers.



## Usage
```javascript
    var alter = require("alter");
    alter("0123456789", [
        {start: 1, end: 3, str: "first"},
        {start: 5, end: 9, str: "second"},
    ]); // => "0first34second9"
```

The fragments does not need to be sorted but must not overlap. More examples in `test/alter-tests.js`


## Installation

### Node
Install using npm

    npm install alter

```javascript
var alter = require("alter");
```

### Browser
Clone the repo and include it in a script tag

    git clone https://github.com/olov/alter.git

```html
<script src="alter/alter.js"></script>
```

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