async-regexp-replace
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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'

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.1.018latest

Version History

VersionDownloads (Last 7 Days)Published
1.1.018
1.0.11
1.0.01

Package Sidebar

Install

npm i async-regexp-replace

Weekly Downloads

20

Version

1.1.0

License

ISC

Unpacked Size

3.92 kB

Total Files

4

Last publish

Collaborators

  • inca