Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • npm
  • Socket score

Version published
Weekly downloads
209K
increased by15.71%
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc