regexpu is a source code transpiler that enables the use of ES2015 Unicode regular expressions (the `u` flag) in ES5 environments. It rewrites regex literals with the `u` flag into equivalent ES5-compatible patterns, handling Unicode properties, escapes, and case folding. Current version 4.8.0 (stable) releases infrequently; major version bumps (e.g., 2.0.0) introduced breaking changes in module export paths. Key differentiators: it is the core engine behind Babel, Traceur, and other transpilers for Unicode regex; also ships `regexpu-core` for programmatic use. Supports Node >=6 and browsers via bundlers.
npm install regexpuNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Transpiles a Unicode regex pattern with the u flag to an ES5-compatible equivalent, demonstrating usage of rewritePattern with options.
Update imports: use require('regexpu-core') or import { rewritePattern } from 'regexpu-core' instead of old require('regexpu').rewritePattern.Switch to require('regexpu-core') for the rewritePattern function.Ensure input is a string pattern (e.g., '\\p{ASCII_Hex_Digit}') not '/\\p{ASCII_Hex_Digit}/u'.Pass options as second or third argument to rewritePattern.
Use import statements: import { rewritePattern } from 'regexpu-core';Install the correct package: npm install regexpu --save (or regexpu-core if using core).
Use named import: import { rewritePattern } from 'regexpu-core';No dependency data recorded yet.