{"id":14685,"library":"lodash._reevaluate","title":"Lodash Internal reEvaluate Module","description":"This package, `lodash._reevaluate`, provides a standalone module for the internal `reEvaluate` function from the Lodash library, specifically mirroring its implementation as found in Lodash version 3.0.0. It was created to offer a modularized CommonJS build for Node.js and io.js environments. The core Lodash library, which this internal function supports, has since evolved to version 4.x, with its most recent release being 4.18.1. Consequently, `lodash._reevaluate` at version 3.0.0 is effectively unmaintained and has not received updates or new features corresponding to the active development of Lodash v4. This means it lacks compatibility with modern Lodash features, bug fixes, and security patches. As an internal helper, its primary role is in supporting Lodash's template compilation engine. Users should be aware that this module represents an outdated snapshot and is not recommended for new projects or integration with current Lodash versions, as its functionality is now handled internally and more robustly within the main `lodash` package.","status":"abandoned","version":"3.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/lodash/lodash","tags":["javascript"],"install":[{"cmd":"npm install lodash._reevaluate","lang":"bash","label":"npm"},{"cmd":"yarn add lodash._reevaluate","lang":"bash","label":"yarn"},{"cmd":"pnpm add lodash._reevaluate","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This module is a CommonJS-only package. Direct ESM `import` statements are not supported without a transpiler/bundler, and the module does not provide a default export for ESM.","wrong":"import reEvaluate from 'lodash._reevaluate';","symbol":"reEvaluate","correct":"const reEvaluate = require('lodash._reevaluate');"},{"note":"This package does not offer named exports for ESM consumption. It exports a single function as its `module.exports` object.","wrong":"import { reEvaluate } from 'lodash._reevaluate';","symbol":"reEvaluate (named)","correct":"const reEvaluate = require('lodash._reevaluate');"},{"note":"This package does not ship with TypeScript type definitions, reflecting its age and status as an internal Lodash v3 module. Type declarations would need to be provided externally.","wrong":"import type { ReEvaluateFunction } from 'lodash._reevaluate';","symbol":"Type of reEvaluate","correct":"/* No official types provided */"}],"quickstart":{"code":"const reEvaluate = require('lodash._reevaluate');\n\n// reEvaluate is an internal Lodash function primarily used for template compilation.\n// It expects a string template and an object representing the data context.\n// This example is illustrative; direct use of this internal function is rare outside of Lodash's own core.\n\nconst compiledTemplate = reEvaluate('<%- envVar %>: <%= value %>', {\n  escape: (val) => String(val).replace(/[&<>'\"`/]/g, ''),\n  interpolate: (val) => String(val),\n  evaluate: (val) => { try { return eval(val); } catch (e) { return ''; } } // UNSAFE for untrusted input\n});\n\nconsole.log(compiledTemplate({ envVar: 'NODE_ENV', value: process.env.NODE_ENV ?? 'development' }));\n\n// Note: This package is for Lodash v3 internals. Modern Lodash (v4+) handles templating differently and securely.\n// Direct usage of 'reEvaluate' is generally discouraged and unsupported.","lang":"javascript","description":"Demonstrates how to import and use the internal `reEvaluate` function for a basic templating operation in a CommonJS environment. Highlights its internal nature."},"warnings":[{"fix":"Avoid using this standalone internal module. For templating or similar functionality, rely on the official `lodash.template` function from the main `lodash` package (v4.x), which handles internal logic appropriately. Do not mix `lodash._reevaluate` v3 with `lodash` v4+.","message":"This `lodash._reevaluate` package is locked at version 3.0.0 and is not compatible with or supported for use with Lodash v4.x and newer versions. The main Lodash library introduced significant breaking changes in v4.0.0, and this internal module's implementation is specific to Lodash v3.","severity":"breaking","affected_versions":">=3.0.0 (for this package); >=4.0.0 (for `lodash` package)"},{"fix":"It is strongly recommended not to use this package in new projects. For existing projects, migrate to using the functionalities provided directly by the main `lodash` package (v4.x), which is actively maintained and handles its internal mechanisms more robustly.","message":"This standalone `lodash._reevaluate` package is effectively abandoned and deprecated. It has not received updates since the release of Lodash v3.0.0, meaning it lacks bug fixes, performance improvements, and security patches present in modern Lodash versions.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Ensure that your applications exclusively use actively maintained packages. If you require internal Lodash functionality, use the latest version of the main `lodash` package to benefit from continuous security patching and active maintenance.","message":"As an outdated and unmaintained package, `lodash._reevaluate` may contain unpatched security vulnerabilities. For instance, the main Lodash package (v4.x) has received critical security updates (e.g., GHSA-f23m-r3pf-42rh for prototype pollution in `_.unset` / `_.omit`), but this module would not benefit from such fixes if it were to expose similar issues.","severity":"gotcha","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure you are using CommonJS `require` syntax: `const reEvaluate = require('lodash._reevaluate');`. This module does not provide named or default ESM exports.","cause":"Attempting to use `lodash._reevaluate` in an environment or with a bundler that expects ESM imports, or trying to use a method that isn't the primary export.","error":"TypeError: reEvaluate is not a function"},{"fix":"For ESM environments, you would need to either transpile your code or use a dynamic import workaround (`import('lodash._reevaluate')`). In browsers, a bundler like Webpack or Rollup configured for CommonJS modules is required. However, it's advised to avoid this deprecated package entirely.","cause":"Trying to use this CommonJS-only package directly in an ESM-only Node.js environment, or in a browser without a compatible bundler.","error":"ReferenceError: require is not defined"}],"ecosystem":"npm"}