Skip to content
PluginStats

babel-plugin-transform-do-expressions weekly downloads statistics

By babel (204 listings) · npm · Babel plugins

Compile do expressions to ES5

View on npm Stale · Oct 17, 2026

babel-plugin-transform-do-expressions has 130,778 recorded weekly downloads on npm, a decrease of 50.5% over the past 30 days, ranking #425 of 2,256 tracked listings.

Weekly downloads
130,778
Official API · Oct 17, 2026
7-day growth
-48.1%
-121K weekly downloads
30-day growth
-50.5%
-133.4K weekly downloads
90-day growth
-62.2%
-214.8K weekly downloads
Rank
#425
Among tracked npm listings

About babel-plugin-transform-do-expressions

babel-plugin-transform-do-expressions

Compile do expressions to ES5

Detail

The do { .. } expression executes a block (with one or many statements in it), and the final statement completion value inside the block becomes the completion value of the do expression.

from You Don't Know JS

It can be seen as a complex version of the ternary operator:

Try in REPL%20%7B%0A%20%20%20%20'big'%3B%0A%20%20%7D%20else%20%7B%0A%20%20%20%20'small'%3B%0A%20%20%7D%0A%7D%3B%0A%0Aconsole.log(a)%3B)

This example is not the best usage because it is too simple and using a ternary operator is a better option but you can have a much more complex condition in the do { ... } expression with several if ... else chains:

Try in REPL%20%7B%0A%20%20%20%20if(y%20%3E%2020)%20%7B%0A%20%20%20%20%20%20'big%20x%2C%20big%20y'%3B%0A%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20'big%20x%2C%20small%20y'%3B%0A%20%20%20%20%7D%0A%20%20%7D%20else%20%7B%0A%20%20%20%20if(y%20%3E%2010)%20%7B%0A%20%20%20%20%20%20'small%20x%2C%20big%20y'%3B%0A%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20'small%20x%2C%20small%20y'%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%3B%0A%0Aconsole.log(a)%3B)

Example

In JSX

One of the most useful usage of the do expression is inside JSX. If we want to conditionally display a component we usually have to call another function which would implement the condition and return the correct value, for example:

Using a do expression you can add logic inside JSX:

Try in REPL%20%7B%20%3CBlueComponent%2F%3E%3B%20%7D%0A%20%20%20%20%20%20if(color%20%3D%3D%3D%20'red')%20%7B%20%3CRedComponent%2F%3E%3B%20%7D%0A%20%20%20%20%20%20if(color%20%3D%3D%3D%20'green')%20%7B%20%3CGreenComponent%2F%3E%3B%20%7D%0A%20%20%20%20%7D%7D%0A%20%20%3C%2Fdiv%3E%0A%3B)

Installation

Usage

Via .babelrc (Recommended)

.babelrc

Via CLI

Via Node API

References

• Proposal • You Don't Know JS • Very handy for conditions inside JSX: reactjs/react-future#35

Description from the npm listing.

  • babel-plugin

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-transform-do-expressions weekly downloads on npm, last 90 days: 130,778 weekly downloads as of Oct 17, 2026, -62.2% over 90 days.babel-plugin-transform-do-expressionsWeekly downloads on npm · Last 90 days130,778downloads / week-62.2% over 90 days0100K200K300K400K500KJul 19Aug 3Aug 18Sep 2Sep 17Oct 2Oct 17downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 17, 2026 · 88 observations · Updated Oc…pluginstats.com
babel-plugin-transform-do-expressions weekly downloads on npm, last 90 days: 130,778 weekly downloads as of Oct 17, 2026, -62.2% over 90 days.

7/30/90-day growth

babel-plugin-transform-do-expressions weekly downloads growth on npm: -48.1% over 7 days, -50.5% over 30 days, -62.2% over 90 days.babel-plugin-transform-do-expressionsWeekly downloads growth on npm130,778downloads / week now7-day growth-120,988 weekly downloads-48.1%30-day growth-133,411 weekly downloads-50.5%90-day growth-214,773 weekly downloads-62.2%Growth vs. nearest observation to each baseline date · Updated Oct 17, 2026pluginstats.com
babel-plugin-transform-do-expressions weekly downloads growth on npm: -48.1% over 7 days, -50.5% over 30 days, -62.2% over 90 days.

Ranking history

babel-plugin-transform-do-expressions npm ranking history: currently #425 (by weekly downloads).babel-plugin-transform-do-expressionsnpm ranking · by weekly downloads · Last 90 days#425current rank#100#150#200#250#300#350#400#450Jul 21Aug 5Aug 20Sep 4Sep 19Oct 4Oct 19rankOct 17, 2026 – Oct 19, 2026 · 3 observations · Updated Oct 17, 2026pluginstats.com
babel-plugin-transform-do-expressions npm ranking history: currently #425 (by weekly downloads).

Listing placement

All npm2,256 listings · 113 pages · 1,129 shown · page 22, #5 (overall #425)
All npm: every listing in weekly downloads order

Listing placement

Babel plugins251 listings · 13 pages · page 11, #15 (overall #215)
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 (543)
Recent weekly downloads observations for babel-plugin-transform-do-expressions
Date (UTC)Weekly downloadsChange vs. previous
130,778-32.5K
163,269-1.9K
165,127-49.8K
214,941-49.4K
264,3180
264,318+6K
258,351+6.6K
251,766+4.8K
246,923+4.1K
242,818-678
243,496-1.5K
244,961-50.6K
295,580-6.9K
302,462—

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-do-expressions. First seen Oct 16, 2026; last successful collection Oct 19, 2026. See the methodology.