babel-plugin-const-enum weekly downloads statistics
By dosentmatter · npm · Babel plugins
Transform TypeScript `const` enums
babel-plugin-const-enum has 2,352,090 recorded weekly downloads on npm, a decrease of 41.7% over the past 30 days.
It ranks #152 of 2,251 tracked npm listings by weekly downloads.
Over 90 days, weekly downloads changed by -43.8%.
PluginStats has 543 daily observations since Apr 23, 2025; the latest is from Oct 17, 2026.
About babel-plugin-const-enum
babel-plugin-const-enum ·
Transform TypeScript const enums
Install
Using npm:
or using yarn:
Usage
You are most likely using @babel/preset-typescript or @babel/plugin-transform-typescript along with this plugin.
If you are using @babel/preset-typescript, then nothing special needs to be done since plugins run before presets.
If you are using @babel/plugin-transform-typescript, then make sure that babel-plugin-const-enum comes before @babel/plugin-transform-typescript in the plugin array so that babel-plugin-const-enum runs first. This plugin needs to run first to transform the const enums into code that @babel/plugin-transform-typescript allows.
.babelrc
transform: removeConst (default)
Removes the const keyword to use regular enum. Can be used in a slower dev build to allow const, while prod still uses tsc. See babel#6476.
.babelrc
Or Explicitly:
.babelrc
transform: constObject
Transforms into a const object literal. Can be further compressed using Uglify/Terser to inline enum access. See babel#8741.
.babelrc
Troubleshooting
SyntaxError
You may be getting a SyntaxError because you are running this plugin on non-TypeScript source. You might have run into this problem in react-native, see: babel-plugin-const-enum#2 babel-plugin-const-enum#3
This seems to be caused by react-native transpiling flow code in node_modules. To fix this issue, please use babel-preset-const-enum to only run babel-plugin-const-enum on TypeScript files. If you wish to fix the issue manually, check out the solution in babel-plugin-const-enum#2.
Description from the npm listing.
- babel-plugin
- typescript
- const
- enum
- terser
- uglify
- minify
- compress
Where babel-plugin-const-enum 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 (543)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-const-enum. First seen Oct 16, 2026; last successful collection Oct 18, 2026. See the methodology.