Skip to content
PluginStats

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

By babel (206 listings) · npm · Babel plugins

Compile do expressions to ES5

View on npm Fresh · Dec 6, 2026

babel-plugin-transform-do-expressions has 266,611 recorded weekly downloads on npm, a decrease of 5.6% over the past 30 days, ranking #486 of 3,247 tracked listings.

Weekly downloads
266,611
Official API · Dec 5, 2026
7-day growth
-2.7%
-7.4K weekly downloads
30-day growth
-5.6%
-15.7K weekly downloads
90-day growth
-1.9%
-5.3K weekly downloads
Rank
#486
▼ 19 in 7 days

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: 266,611 weekly downloads as of Dec 5, 2026, -1.9% over 90 days.babel-plugin-transform-do-expressionsWeekly downloads on npm · Last 90 days266,611downloads / week-1.9% over 90 days0100K200K300K400K500KSep 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-transform-do-expressions weekly downloads on npm, last 90 days: 266,611 weekly downloads as of Dec 5, 2026, -1.9% over 90 days.

7/30/90-day growth

babel-plugin-transform-do-expressions weekly downloads growth on npm: -2.7% over 7 days, -5.6% over 30 days, -1.9% over 90 days.babel-plugin-transform-do-expressionsWeekly downloads growth on npm266,611downloads / week now7-day growth-7,365 weekly downloads-2.7%30-day growth-15,737 weekly downloads-5.6%90-day growth-5,292 weekly downloads-1.9%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
babel-plugin-transform-do-expressions weekly downloads growth on npm: -2.7% over 7 days, -5.6% over 30 days, -1.9% over 90 days.

Ranking history

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

Listing placement

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

Listing placement

Babel plugins263 listings · 14 pages · page 12, #2 (overall #222)
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-transform-do-expressions
Date (UTC)Weekly downloadsChange vs. previous
266,611-1K
267,621-2.5K
270,151+2K
268,115-4.7K
272,839+4.2K
268,687-298
268,985-5K
273,976-2.8K
276,802-54
276,856-4.3K
281,139+2.2K
278,910-4K
282,953+2.7K
280,291—

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