1.1.0 • Published 3 years ago

async-regexp-replace v1.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Async Regexp Replace

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'
1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago