Skip to content
PluginStats

babel-plugin-const-enum weekly downloads statistics

By dosentmatter · npm · Babel plugins

Transform TypeScript `const` enums

View on npm Fresh · Dec 6, 2026

babel-plugin-const-enum has 8,009,641 recorded weekly downloads on npm, an increase of 19.2% over the past 30 days, ranking #153 of 3,247 tracked listings.

Weekly downloads
8,009,641
Official API · Dec 5, 2026
7-day growth
+13.3%
+937.3K weekly downloads
30-day growth
+19.2%
+1.3M weekly downloads
90-day growth
+100%
+4M weekly downloads
Rank
#153
Among tracked npm listings

About babel-plugin-const-enum

babel-plugin-const-enum · npm version npm downloads

Transform TypeScript const enums

Install

Using npm:

npm install --save-dev babel-plugin-const-enum

or using yarn:

yarn add babel-plugin-const-enum --dev

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

{
  "plugins": ["const-enum", "@babel/transform-typescript"]
}
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.

// Before:
const enum MyEnum {
  A = 1,
  B = A,
  C,
  D = C,
  E = 1,
  F,
  G = A * E,
  H = A ** B ** C,
  I = A << 20
}

// After:
enum MyEnum {
  A = 1,
  B = A,
  C,
  D = C,
  E = 1,
  F,
  G = A * E,
  H = A ** B ** C,
  I = A << 20
}

.babelrc

{
  "plugins": [
    "const-enum"
  ]
}

Or Explicitly:

.babelrc

{
  "plugins": [
    [
      "const-enum",
      {
        "transform": "removeConst"
      }
    ]
  ]
}
transform: constObject

Transforms into a const object literal. Can be further compressed using Uglify/Terser to inline enum access. See babel#8741.

// Before:
const enum MyEnum {
  A = 1,
  B = A,
  C,
  D = C,
  E = 1,
  F,
  G = A * E,
  H = A ** B ** C,
  I = A << 20
}

// After:
const MyEnum = {
  A: 1,
  B: 1,
  C: 2,
  D: 2,
  E: 1,
  F: 2,
  G: 1,
  H: 1,
  I: 1048576
};

.babelrc

{
  "plugins": [
    [
      "const-enum",
      {
        "transform": "constObject"
      }
    ]
  ]
}

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:<br> babel-plugin-const-enum#2<br> 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

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

babel-plugin-const-enum weekly downloads on npm, last 90 days: 8,009,641 weekly downloads as of Dec 5, 2026, +100% over 90 days.babel-plugin-const-enumWeekly downloads on npm · Last 90 days8,009,641downloads / week+100% over 90 days02M4M6M8M10MSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
babel-plugin-const-enum weekly downloads on npm, last 90 days: 8,009,641 weekly downloads as of Dec 5, 2026, +100% over 90 days.

7/30/90-day growth

babel-plugin-const-enum weekly downloads growth on npm: +13.3% over 7 days, +19.2% over 30 days, +100% over 90 days.babel-plugin-const-enumWeekly downloads growth on npm8,009,641downloads / week now7-day growth+937,296 weekly downloads+13.3%30-day growth+1,289,797 weekly downlo…+19.2%90-day growth+4,007,410 weekly downlo…+100%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
babel-plugin-const-enum weekly downloads growth on npm: +13.3% over 7 days, +19.2% over 30 days, +100% over 90 days.

Ranking history

babel-plugin-const-enum npm ranking history: currently #153 (by weekly downloads).babel-plugin-const-enumnpm ranking · by weekly downloads · Last 90 days#153current rank#40#60#80#100#120#140#160Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 45 observations · Updated Dec 5, 2026pluginstats.com
babel-plugin-const-enum npm ranking history: currently #153 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 8, #13 (overall #153)
All npm: every listing in weekly downloads order

Listing placement

Babel plugins263 listings · 14 pages · page 6, #11 (overall #111)
Babel plugins: every listing in weekly downloads order

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.

Each band is one page of 20. Weekly downloads on a linear 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.

Recent observations

Full history (592)
Recent weekly downloads observations for babel-plugin-const-enum
Date (UTC)Weekly downloadsChange vs. previous
8,009,641+107.1K
7,902,578+327.8K
7,574,740+293.7K
7,281,083+152.6K
7,128,479+62.1K
7,066,368+10.6K
7,055,806-16.5K
7,072,345-27.7K
7,100,001-179.8K
7,279,789-180.3K
7,460,120-105.9K
7,565,992+34.3K
7,531,691+3.5K
7,528,214—

Similar npm Babel plugins plugins

All 20 babel-plugin-const-enum alternatives

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 Dec 6, 2026. See the methodology.