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 Fresh · Oct 18, 2026

babel-plugin-transform-do-expressions has 158,777 recorded weekly downloads on npm, a decrease of 42.4% over the past 30 days, ranking #422 of 2,322 tracked listings.

Weekly downloads
158,777
Official API · Oct 18, 2026
7-day growth
-38.5%
-99.6K weekly downloads
30-day growth
-42.4%
-117K weekly downloads
90-day growth
-53.3%
-181.5K weekly downloads
Rank
#422
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:

let a = do {
  if(x > 10) {
    'big';
  } else {
    'small';
  }
};
// is equivalent to:
let a = x > 10 ? 'big' : 'small';

Try in REPL

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:

let x = 100;
let y = 20;

let a = do {
  if(x > 10) {
    if(y > 20) {
      'big x, big y';
    } else {
      'big x, small y';
    }
  } else {
    if(y > 10) {
      'small x, big y';
    } else {
      'small x, small y';
    }
  }
};

Try in REPL

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:

const getColoredComponent = color => {
  if(color === 'blue') { return <BlueComponent/>; }
  if(color === 'red') { return <RedComponent/>; }
  if(color === 'green') { return <GreenComponent/>; }
}

const Component = props =>
  <div className='myComponent'>
    {getColoredComponent()}
  </div>
;

Using a do expression you can add logic inside JSX:

const Component = props =>
  <div className='myComponent'>
    {do {
      if(color === 'blue') { <BlueComponent/>; }
      if(color === 'red') { <RedComponent/>; }
      if(color === 'green') { <GreenComponent/>; }
    }}
  </div>
;

Try in REPL

Installation

npm install --save-dev babel-plugin-transform-do-expressions

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["transform-do-expressions"]
}
Via CLI
babel --plugins transform-do-expressions script.js
Via Node API
require("babel-core").transform("code", {
  plugins: ["transform-do-expressions"]
});

References

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: 158,777 weekly downloads as of Oct 18, 2026, -53.3% over 90 days.babel-plugin-transform-do-expressionsWeekly downloads on npm · Last 90 days158,777downloads / week-53.3% over 90 days0100K200K300K400K500KJul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 18, 2026 · 89 observations · Updated Oc…pluginstats.com
babel-plugin-transform-do-expressions weekly downloads on npm, last 90 days: 158,777 weekly downloads as of Oct 18, 2026, -53.3% over 90 days.

7/30/90-day growth

babel-plugin-transform-do-expressions weekly downloads growth on npm: -38.5% over 7 days, -42.4% over 30 days, -53.3% over 90 days.babel-plugin-transform-do-expressionsWeekly downloads growth on npm158,777downloads / week now7-day growth-99,574 weekly downloads-38.5%30-day growth-116,958 weekly downloads-42.4%90-day growth-181,474 weekly downloads-53.3%Growth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
babel-plugin-transform-do-expressions weekly downloads growth on npm: -38.5% over 7 days, -42.4% over 30 days, -53.3% over 90 days.

Ranking history

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

Listing placement

All npm2,320 listings · 116 pages · 1,162 shown · page 22, #2 (overall #422)
All npm: every listing in weekly downloads order

Listing placement

Babel plugins252 listings · 13 pages · page 11, #13 (overall #213)
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 (544)
Recent weekly downloads observations for babel-plugin-transform-do-expressions
Date (UTC)Weekly downloadsChange vs. previous
158,777+28K
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—

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