alter

WebJar for alter

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

alter
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

alter
WebJar for alter
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/olov/alter

Download alter

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/alter/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>alter</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/alter/
implementation 'org.webjars.npm:alter:0.2.0'
// https://jarcasting.com/artifacts/org.webjars.npm/alter/
implementation ("org.webjars.npm:alter:0.2.0")
'org.webjars.npm:alter:jar:0.2.0'
<dependency org="org.webjars.npm" name="alter" rev="0.2.0">
  <artifact name="alter" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='alter', version='0.2.0')
)
libraryDependencies += "org.webjars.npm" % "alter" % "0.2.0"
[org.webjars.npm/alter "0.2.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : stable jar [0.1.3,0.2)

Project Modules

There are no modules declared in this project.

alter.js

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

Usage

    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
var alter = require("alter");

Browser

Clone the repo and include it in a script tag

git clone https://github.com/olov/alter.git
<script src="alter/alter.js"></script>

Versions

Version
0.2.0