Skip to content
PluginStats

babel-plugin-add-module-exports weekly downloads statistics

By 59naga · npm · Babel plugins

Fix babel/babel#2212

View on npm Stale · Oct 18, 2026

babel-plugin-add-module-exports has 586,020 recorded weekly downloads on npm, a decrease of 37.6% over the past 30 days, ranking #260 of 2,391 tracked listings.

Weekly downloads
586,020
Official API · Oct 18, 2026
7-day growth
-43.5%
-450.9K weekly downloads
30-day growth
-37.6%
-353.6K weekly downloads
90-day growth
-48.5%
-552.7K weekly downloads
Rank
#260
Among tracked npm listings

About babel-plugin-add-module-exports

babel-plugin-add-module-exports

<p align="right"> <a href="https://npmjs.org/package/babel-plugin-add-module-exports"> <img src="https://img.shields.io/npm/v/babel-plugin-add-module-exports.svg?style=flat-square"> </a> <a href="https://travis-ci.org/59naga/babel-plugin-add-module-exports"> <img src="http://img.shields.io/travis/59naga/babel-plugin-add-module-exports.svg?style=flat-square"> </a> </p>

Why?

Babel@6 doesn't export default module.exports any more - T2212 Kill CommonJS default export behavior.

Babel@6 transforms the following file

export default 'foo'

into

'use strict';
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = 'foo';

Therefore, it is a need to use the ugly .default in node.js.

require('./bundle.js') // { default: 'foo' }
require('./bundle.js').default // 'foo'

This plugin follows the babel@5 behavior - add the module.exports if only the export default declaration exists.

'use strict';
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = 'foo';
module.exports = exports['default'];

Therefore, our old codes still work fine - the .default goes away. :wink:

require('./bundle.js') // foo

Usage

Install this plugin from npm:

npm install babel-plugin-add-module-exports --save-dev
# or
yarn add -D babel-plugin-add-module-exports

Write the name to babelrc. It works with preset-env to output CommonJS code:

{
  "presets": ["@babel/env"],
  "plugins": ["add-module-exports"]
}
modules: false

However, the plugin doesn't change the pure-esmodule. this plugin makes changes only when exists exports.default (in other words, using commonjs).

{
  "presets": [["@babel/env", { "modules": false }]],
  "plugins": ["add-module-exports"]
}

into

export default 'foo'

1.0.0 Currently support is commonjs and umd. Doesn't support amd, systemjs modules(don't use. there are no plans to support at the moment).

with Webpack

Likewise, webpack doesn't perform commonjs transformation for codesplitting. Need to set commonjs conversion.

{
  "presets": [["@babel/env", { "modules": "commonjs" }]],
  "plugins": ["add-module-exports"]
}

Options

addDefaultProperty

If you're exporting an object and wish to maintain compatibility with code using the require('./bundle.js').default syntax, you can optionally enable the addDefaultProperty option as follows:

{
  "presets": ["env"],
  "plugins": [
    [
      "add-module-exports",
      {
        "addDefaultProperty": true
      }
    ]
  ]
}

This will cause a second line of code to be added which aliases the default name to the exported object like so:

module.exports = exports['default'];
module.exports.default = exports['default']

See also

License

MIT

Description from the npm listing.

  • babel-plugin
  • module.exports

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-add-module-exports weekly downloads on npm, last 90 days: 586,020 weekly downloads as of Oct 18, 2026, -48.5% over 90 days.babel-plugin-add-module-exportsWeekly downloads on npm · Last 90 days586,020downloads / week-48.5% over 90 days400K600K800K1M1.2M1.4MJul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 23, 2026 – Oct 18, 2026 · 88 observations · Updated Oc…pluginstats.com
babel-plugin-add-module-exports weekly downloads on npm, last 90 days: 586,020 weekly downloads as of Oct 18, 2026, -48.5% over 90 days.

7/30/90-day growth

babel-plugin-add-module-exports weekly downloads growth on npm: -43.5% over 7 days, -37.6% over 30 days, -48.5% over 90 days.babel-plugin-add-module-exportsWeekly downloads growth on npm586,020downloads / week now7-day growth-450,862 weekly downloads-43.5%30-day growth-353,582 weekly downloads-37.6%90-day growth-552,701 weekly downloads-48.5%Growth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
babel-plugin-add-module-exports weekly downloads growth on npm: -43.5% over 7 days, -37.6% over 30 days, -48.5% over 90 days.

Ranking history

babel-plugin-add-module-exports npm ranking history: currently #260 (by weekly downloads).babel-plugin-add-module-exportsnpm ranking · by weekly downloads · Last 90 days#260current rank#50#100#150#200#250#300Jul 23Aug 7Aug 22Sep 6Sep 21Oct 6Oct 21rankOct 17, 2026 – Oct 21, 2026 · 5 observations · Updated Oct 18, 2026pluginstats.com
babel-plugin-add-module-exports npm ranking history: currently #260 (by weekly downloads).

Listing placement

All npm2,389 listings · 120 pages · 1,196 shown · page 13, #20 (overall #260)
All npm: every listing in weekly downloads order

Listing placement

Babel plugins252 listings · 13 pages · page 8, #10 (overall #150)
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-add-module-exports
Date (UTC)Weekly downloadsChange vs. previous
586,020+78.4K
507,580-89K
596,539+7.8K
588,755-224.2K
812,951-227K
1,039,9170
1,039,917+3K
1,036,882+15.4K
1,021,493+10.9K
1,010,578+31.3K
979,304+20.4K
958,861+20.5K
938,362-201.4K
1,139,732—

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-add-module-exports. First seen Oct 16, 2026; last successful collection Oct 21, 2026. See the methodology.