babel-plugin-transform-replace-expressions weekly downloads statistics
By jviide · npm · Babel plugins
Replace JavaScript expressions with other expressions
babel-plugin-transform-replace-expressions has 60,174 recorded weekly downloads on npm, a decrease of 47.9% over the past 30 days.
It ranks #519 of 2,251 tracked npm listings by weekly downloads.
Over 90 days, weekly downloads changed by -50.1%.
PluginStats has 121 daily observations since Jun 19, 2026; the latest is from Oct 17, 2026.
About babel-plugin-transform-replace-expressions
babel-plugin-transform-replace-expressions
Replace JavaScript expressions with other expressions.
Installation
Example
Input file:
.babelrc:
Output:
Conflict resolution
A conflict happens when two replacements have the same Babel abstract syntax tree representation. For example expressions typeof A and typeof (A) are formatted differently but have the same AST representation as far as the plugin is concerned. In those situations the default is to raise an error, and can be overwritten by setting the option allowConflictingReplacements to true.
You can also always give the replacements as an array of key-value pairs. When allowConflictingReplacements is set to true the _last_ conflicting replacement gets selected.
Notes
• Replacements are only applied to expressions. Therefore replacing DEBUG with false in const DEBUG = true does nothing, but for if (DEBUG) {} the result is if (false) {}. • Only *full* expressions count. You can't replace env in process.env.NODE_ENV, you have to replace process.env, which is a proper expression in Babel AST. • A replacement is only applied when the result is valid JavaScript. For example replacing a with 2 in the following code: yields
License
This plugin is licensed under the MIT license. See LICENSE.
Description from the npm listing.
- babel-plugin
Where babel-plugin-transform-replace-expressions sits in the listing
Each band is one page of 20. Weekly downloads on a log scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Recent observations
Full history (121)Similar npm Babel plugins plugins
Data source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/babel-plugin-transform-replace-expressions. First seen Oct 16, 2026; last successful collection Oct 18, 2026. See the methodology.