Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

regexpu

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

regexpu

A source code transpiler that enables the use of ES6 Unicode regular expressions in ES5.

  • 0.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
214K
increased by98.66%
Maintainers
1
Weekly downloads
 
Created

What is regexpu?

The regexpu package is a tool that transforms regular expressions written in ES6/ES2015+ syntax into equivalent ES5-compatible code. This is particularly useful for developers who want to use modern JavaScript features while maintaining compatibility with older environments.

What are regexpu's main functionalities?

Transform Unicode Regular Expressions

This feature allows you to transform regular expressions that use the 'u' flag for Unicode support into equivalent ES5-compatible code. The code sample demonstrates how to use regexpu to transform a simple Unicode regular expression.

const regexpu = require('regexpu-core');
const output = regexpu('foo', 'u', { unicode: true });
console.log(output); // Output: 'foo'

Transform Sticky Regular Expressions

This feature allows you to transform regular expressions that use the 'y' flag for sticky matching into equivalent ES5-compatible code. The code sample shows how to transform a sticky regular expression.

const regexpu = require('regexpu-core');
const output = regexpu('foo', 'y', { sticky: true });
console.log(output); // Output: '(?:foo)'

Transform DotAll Regular Expressions

This feature allows you to transform regular expressions that use the 's' flag for dotAll mode into equivalent ES5-compatible code. The code sample illustrates how to transform a dotAll regular expression.

const regexpu = require('regexpu-core');
const output = regexpu('foo.bar', 's', { dotAll: true });
console.log(output); // Output: 'foo[\s\S]bar'

Other packages similar to regexpu

Keywords

FAQs

Package last updated on 10 Oct 2014

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