New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

async-regexp-replace

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-regexp-replace

String.replace with asynchronous replacer function

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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'

Keywords

FAQs

Package last updated on 10 Sep 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc