import { asyncRegexpReplace } from 'async-regexp-replace';
const source = 'The quick brown fox jumps over the lazy dog';
const result = await asyncRegexpReplace(source, /(brown|lazy)\s/g, async m => {
// The replacer function can be asynchronous
await new Promise(r => setTimeout(r, 0));
return '';
});
// 'The quick fox jumps over the dog'
async-regexp-replace
1.1.0 • Public • Published Package Sidebar
Install
npm i async-regexp-replace
Repository
Weekly Downloads
20
Version
1.1.0
License
ISC
Unpacked Size
3.92 kB
Total Files
4