Supports global replacement, case-insensitive mode, start index control, and functional replacement compatible with native `String.replace`.
npm install fast-replaceall



> High-performance string replacement tool
> Supports global replacement, case-insensitive mode, start index control, and functional replacement compatible with native String.replace.
---
caseInsensitive and fromIndex parameters---
For detailed usage instructions and API references, please visit the official documentation:
---
javascript
import replaceAll from 'fast-replaceall';const text = 'The quick brown fox jumps over the lazy dog';
console.log(replaceAll(text, 'dog', 'monkey'));
// Output: The quick brown fox jumps over the lazy monkey
`$3
`javascript
replaceAll('123-456', '-', (match, offset) => _${offset}_);
// Output: 123_0_456
`$3
`javascript
// Case-insensitive replacement
replaceAll('Apple apple', 'APPLE', 'ORANGE', { caseInsensitive: true });
// Output: ORANGE ORANGE// Start replacing from index 2
replaceAll('aaaa', 'a', '*', { fromIndex: 2 });
// Output: aa**
``---
We welcome contributions from the community! If you find a bug or want to suggest an improvement, feel free to open an issue or submit a pull request.
---
This project is licensed under the MIT License.
---
!Chrome | !Firefox | !Safari | !Opera | !Edge |
--- | --- | --- | --- | --- |
Latest ā | Latest ā | Latest ā | Latest ā | Latest ā |