
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
ultimate-string-replace
Advanced tools
Javascript library to allow to find and wrap matches in a string.
It's main purpose is to be used in filters of objects, so you can highlight matches.
If the string has accents, ultimate-string-replace will get rid of them and match anyway.
If the string to match has accents, it will only match exact matches (case-insensitive).
npm i -S ultimate-string-replace
ultimate-string-replace is also published in bower
bower install ultimate-string-replace
import ultimateStringReplace from 'ultimate-string-replace';
const data = "Crème brûlée"
const response = ultimateStringReplace(data, "rème brûlée", {'wrap_preffix': "<b>", 'wrap_sufix': "</b>" })
// Result -> 'C<b>rème brûlée</b>';
| Matcher | Input | Output |
|---|---|---|
he | Hello hello | <b>He</b>llo <b>he</b>llo |
23 | 12 34 | 1<b>2 3</b>4 |
rème brûlée | Crème brûlée | C<b>rème brûlée</b> |
ví | Víctor victor Victor | <b>Ví</b>ctor victor Victor |
vi | Víctor victor Victor | <b>Ví</b>ctor <b>vi</b>ctor <b>Vi<b>ctor |
Ví | Víctor victor Victor | <b>Ví</b>ctor victor Victor |
no | Víctor victor Victor | false |
npm run test
npm run build
ultimate-string-replace is written as an ES6 module, but it also gets transpiled to ES5.
PR Welcome!
FAQs
JS module to improve string.prototype.replace
The npm package ultimate-string-replace receives a total of 5 weekly downloads. As such, ultimate-string-replace popularity was classified as not popular.
We found that ultimate-string-replace demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.