Registry / serialization / lodash._reescape

lodash._reescape

JSON →
library3.0.0jsnpmunverified

lodash._reescape is an abandoned npm package that exports an internal `reEscape` utility function from Lodash v3.0.0. Published over a decade ago (February 2015) and never updated, it is a snapshot of an internal helper used by the main Lodash library at that time. While the core Lodash library (currently v4.18.1) remains actively developed with a regular release cadence, this specific modular build is no longer maintained as a standalone package. Its purpose was to escape regular expression special characters in strings, a functionality now integrated directly into modern `lodash` builds, typically via `_.escapeRegExp`. This package should be considered deprecated and potentially insecure due to its age and lack of updates, especially given known vulnerabilities in Lodash v3.

npm install lodash._reescape
INSTALL
IMPORT
SIG · LODASH._REESCAPE
L
lodash._reescape
serializationjavascriptv3.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

reEscape
const reEscape = require('lodash._reescape');
import reEscape from 'lodash._reescape';
This package is CommonJS only and was last published in 2015. It does not support ES module syntax directly.

Demonstrates the use of the `reEscape` function to escape a string for safe inclusion in a regular expression pattern, reflecting its original utility.

const reEscape = require('lodash._reescape'); // This internal utility is designed to escape characters // that have special meaning in regular expressions. const regexString = 'user.name?id=123&query=test'; const escapedRegex = reEscape(regexString); console.log(`Original: ${regexString}`); console.log(`Escaped for RegExp: ${escapedRegex}`); // Example of how it might be used in a regular expression constructor const searchPattern = new RegExp(escapedRegex, 'i'); const testString = 'The user.name?id=123&query=test was found.'; console.log(`Matches: ${searchPattern.test(testString)}`); // For modern Lodash users, prefer _.escapeRegExp from the main library // const _ = require('lodash'); // console.log(`Modern Lodash equivalent: ${_.escapeRegExp(regexString)}`);
Debug
Known issues
breakingThis package is explicitly Lodash v3.0.0. Major breaking changes were introduced in Lodash v4.0.0, impacting method signatures, behaviors, and module structures. Attempting to use this package alongside a modern Lodash (v4+) installation may lead to runtime errors or unexpected behavior due to API inconsistencies.
fix
Migrate to `_.escapeRegExp` from the main `lodash` library (v4+) or `lodash-es` for equivalent, maintained functionality. Avoid using this standalone package in new or actively maintained projects.
affects: all
gotchaThis package exports an *internal* Lodash utility. Internal utilities are not part of Lodash's public API and are subject to change without notice in the main Lodash library. As this package is abandoned, its API is fixed but is not guaranteed to align with the `reEscape` (or `escapeRegExp`) implementation in newer Lodash versions.
fix
Rely on the officially documented and maintained public API methods from the main `lodash` or `lodash-es` packages, specifically `_.escapeRegExp`.
affects: all
breakingLodash v3, which this package is based on, has several known, unpatched high-severity security vulnerabilities, including prototype pollution (e.g., CVE-2020-8203) and code injection issues (e.g., CVE-2021-23337 via `_.template`). Using this unmaintained package could expose applications to these risks if not properly sandboxed or if handling untrusted input.
fix
Immediately cease direct use of this package. Update to the latest official `lodash` version (v4.18.1 or newer) which includes patches for many known vulnerabilities, or use alternative, actively maintained string escaping utilities. Consider using a service like HeroDevs for Never-Ending Support if a full migration from Lodash 3.x is not immediately feasible.
affects: 3.0.0
gotchaAs a package from 2015, `lodash._reescape` is designed for CommonJS environments (`require`). It does not provide native ES module exports and cannot be directly `import`ed in modern JavaScript projects without a transpilation step or specific bundler configurations, which is discouraged for an abandoned package.
fix
If stuck on an old CommonJS environment, use `const reEscape = require('lodash._reescape');`. For modern ESM projects, import `_.escapeRegExp` from the `lodash-es` package: `import { escapeRegExp } from 'lodash-es';`.
affects: all
Errors
Common errors & fixes
TypeError: reEscape is not a function
Attempting to use `reEscape` after an incorrect or failed CommonJS `require` call, or trying to destructure it as a named export from an ES module context.
fix
Ensure you are using `const reEscape = require('lodash._reescape');` and that the package is correctly installed in a CommonJS environment. For ES Modules, do not use this package; use `import { escapeRegExp } from 'lodash-es';` instead.
Error: Can't walk dependency graph: Cannot find module 'lodash/string/template' (or similar 'lodash/_reescape' missing module error in bundlers)
Trying to import an old, granular Lodash v3 module (like `lodash._reescape` or `lodash/string/template`) in a modern bundler configuration that expects Lodash v4+ modular imports or tree-shakable ES modules. This package's path structure is specific to its v3 origin and not compatible with later Lodash versions' module organization.
fix
Remove the `lodash._reescape` dependency. For string escaping, import `escapeRegExp` from the main `lodash` package (e.g., `const escapeRegExp = require('lodash/escapeRegExp');`) or `lodash-es` (`import { escapeRegExp } from 'lodash-es';`).
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
lodash._reescape — npm install lodash._reescape · libregistry