You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

alter

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alter

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

0.2.0
latest
Source
npmnpm
Version published
Weekly downloads
285K
18.54%
Maintainers
1
Weekly downloads
 
Created
Source

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>

Keywords

string

FAQs

Package last updated on 08 Sep 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts