New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

areplace

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

areplace

Replace a set of strings contained in an array with a corresponding string in the 'replacement' array, or use a single string used as 'replacement'. If arrays are used they MUST be the same length. Using the 'g' flag replaces all occurences of search, 'i'

latest
Source
npmnpm
Version
1.0.5
Version published
Maintainers
1
Created
Source

Similar to string.replace, except "search" is an array, and "replace" can be an array or a string.

Example:

var str = 'This fuzzy chipmunk can fly'; str = str.areplace(['fuzzy', 'fly'], ['happy', 'run'], 'gi');

The new string would read 'This happy chipmunk can run'.

The 'gi' is for global replacement, and case insensitive.

Keywords

string

FAQs

Package last updated on 24 May 2021

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